* @link http://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types.
*
* @since 2.6.0
+ * @since 4.3.0 A return value was added.
*
* @param string $handle Name of the stylesheet.
* @param string|bool $src Path to the stylesheet from the WordPress root directory. Example: '/css/mystyle.css'.
* @param string $media Optional. The media for which this stylesheet has been defined.
* Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',
* 'screen', 'tty', or 'tv'.
+ * @return bool Whether the style has been registered. True on success, false on failure.
*/
function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
- wp_styles()->add( $handle, $src, $deps, $ver, $media );
+ return wp_styles()->add( $handle, $src, $deps, $ver, $media );
}
/**
* 'screen', 'tty', or 'tv'.
*/
function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) {
- global $wp_styles;
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
$wp_styles = wp_styles();
/**
* Check whether a CSS stylesheet has been added to the queue.
*
- * @global WP_Styles $wp_styles The WP_Styles object for printing styles.
- *
* @since 2.8.0
*
* @param string $handle Name of the stylesheet.