| | 52 | _wp_register_style( $handle, $src, $deps, $ver, $media, false); |
| | 53 | } |
| | 54 | |
| | 55 | |
| | 56 | /** |
| | 57 | * Register or enqueue a CSS style file. |
| | 58 | * This function should not be called directly, use wp_register_style() or wp_enqueue_style() instead. |
| | 59 | * |
| | 60 | * @since 3.0 |
| | 61 | * @access private |
| | 62 | * @global object $wp_styles The WP_Styles object for printing styles. |
| | 63 | * @see wp_register_style(), wp_enqueue_style(), WP_Styles::add(), WP_Styles::enqueue() |
| | 64 | * |
| | 65 | * @param string $handle Name of the stylesheet. |
| | 66 | * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'. |
| | 67 | * @param array $deps Array of handles of any stylesheet that this stylesheet depends on. |
| | 68 | * (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies. |
| | 69 | * @param string|bool $ver String specifying the stylesheet version number. Set to NULL to disable. |
| | 70 | * Used to ensure that the correct version is sent to the client regardless of caching. |
| | 71 | * @param string $media The media for which this stylesheet has been defined. |
| | 72 | * @param boolean $enqueue If the stylesheet will be enqueued. |
| | 73 | * |
| | 74 | **/ |
| | 75 | function _wp_register_style( $handle, $src, $deps, $ver, $media, $enqueue ) { |
| 96 | | function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = false ) { |
| 97 | | global $wp_styles; |
| 98 | | if ( !is_a($wp_styles, 'WP_Styles') ) |
| 99 | | $wp_styles = new WP_Styles(); |
| 100 | | |
| 101 | | if ( $src ) { |
| 102 | | $_handle = explode('?', $handle); |
| 103 | | $wp_styles->add( $_handle[0], $src, $deps, $ver, $media ); |
| 104 | | } |
| 105 | | $wp_styles->enqueue( $handle ); |
| | 123 | function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) { |
| | 124 | _wp_register_style( $handle, $src, $deps, $ver, $media, true); |