Make WordPress Core


Ignore:
Timestamp:
05/10/2015 07:56:15 PM (10 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.wp-styles.php

    r32041 r32483  
    9999 *
    100100 * @since 2.6.0
     101 * @since 4.3.0 A return value was added.
    101102 *
    102103 * @param string      $handle Name of the stylesheet.
     
    108109 *                            Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',
    109110 *                            'screen', 'tty', or 'tv'.
     111 * @return bool Whether the style has been registered. True on success, false on failure.
    110112 */
    111113function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
    112114    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    113115
    114     wp_styles()->add( $handle, $src, $deps, $ver, $media );
     116    return wp_styles()->add( $handle, $src, $deps, $ver, $media );
    115117}
    116118
Note: See TracChangeset for help on using the changeset viewer.