mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Add a return value to wp_register_script() and wp_register_style() which matches the return value of WP_Dependencies::add().
Props katzwebdesign, pareshradadiya, DrewAPicture. Fixes #31126 git-svn-id: https://develop.svn.wordpress.org/trunk@32483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -98,6 +98,7 @@ function wp_add_inline_style( $handle, $data ) {
|
||||
* @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'.
|
||||
@@ -107,11 +108,12 @@ function wp_add_inline_style( $handle, $data ) {
|
||||
* @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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user