WordPress.org

Make WordPress Core

Changeset 31196


Ignore:
Timestamp:
01/16/2015 02:41:07 AM (6 years ago)
Author:
wonderboymusic
Message:

Make _wp_scripts_maybe_doing_it_wrong( $function ) "private".

Props obenland for the thought leadership.
See #20513.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r31193 r31196  
    3030 *
    3131 * @since 4.2.0
     32 * @access private
    3233 *
    3334 * @param string $function
    3435 */
    35 function wp_scripts_maybe_doing_it_wrong( $function ) {
     36function _wp_scripts_maybe_doing_it_wrong( $function ) {
    3637    if ( did_action( 'init' ) ) {
    3738        return;
     
    7374    }
    7475
    75     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     76    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    7677
    7778    global $wp_scripts;
     
    108109function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
    109110    $wp_scripts = wp_scripts();
    110     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     111    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    111112
    112113    $wp_scripts->add( $handle, $src, $deps, $ver );
     
    148149    global $wp_scripts;
    149150    if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    150         wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     151        _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    151152        return false;
    152153    }
     
    169170 */
    170171function wp_deregister_script( $handle ) {
    171     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     172    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    172173
    173174    /**
     
    221222    $wp_scripts = wp_scripts();
    222223
    223     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     224    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    224225
    225226    $_handle = explode( '?', $handle );
     
    247248 */
    248249function wp_dequeue_script( $handle ) {
    249     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     250    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    250251
    251252    wp_scripts()->dequeue( $handle );
     
    266267 */
    267268function wp_script_is( $handle, $list = 'enqueued' ) {
    268     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     269    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    269270
    270271    return (bool) wp_scripts()->query( $handle, $list );
  • trunk/src/wp-includes/functions.wp-styles.php

    r31194 r31196  
    5353    }
    5454
    55     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     55    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    5656
    5757    global $wp_styles;
     
    8282 */
    8383function wp_add_inline_style( $handle, $data ) {
    84     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     84    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    8585
    8686    if ( false !== stripos( $data, '</style>' ) ) {
     
    110110 */
    111111function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
    112     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     112    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    113113
    114114    wp_styles()->add( $handle, $src, $deps, $ver, $media );
     
    125125 */
    126126function wp_deregister_style( $handle ) {
    127     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     127    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    128128
    129129    wp_styles()->remove( $handle );
     
    152152function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) {
    153153    global $wp_styles;
    154     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     154    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    155155
    156156    $wp_styles = wp_styles();
     
    173173 */
    174174function wp_dequeue_style( $handle ) {
    175     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     175    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    176176
    177177    wp_styles()->dequeue( $handle );
     
    191191 */
    192192function wp_style_is( $handle, $list = 'enqueued' ) {
    193     wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
     193    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    194194
    195195    return (bool) wp_styles()->query( $handle, $list );
Note: See TracChangeset for help on using the changeset viewer.