WordPress.org

Make WordPress Core

Ticket #25666: helpful-doing-it-wrong-messages.patch

File helpful-doing-it-wrong-messages.patch, 11.1 KB (added by bigdawggi, 7 years ago)
  • wp-includes/functions.wp-scripts.php

     
    3232        global $wp_scripts;
    3333        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    3434                if ( ! did_action( 'init' ) )
    35                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    36                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     35                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     36                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    3737
    3838                if ( !$handles )
    3939                        return array(); // No need to instantiate if nothing is there.
     
    6969        global $wp_scripts;
    7070        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    7171                if ( ! did_action( 'init' ) )
    72                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    73                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     72                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     73                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    7474                $wp_scripts = new WP_Scripts();
    7575        }
    7676
     
    109109        global $wp_scripts;
    110110        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    111111                if ( ! did_action( 'init' ) )
    112                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    113                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     112                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     113                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    114114
    115115                return false;
    116116        }
     
    135135        global $wp_scripts;
    136136        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    137137                if ( ! did_action( 'init' ) )
    138                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    139                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     138                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     139                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    140140                $wp_scripts = new WP_Scripts();
    141141        }
    142142
     
    191191        global $wp_scripts;
    192192        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    193193                if ( ! did_action( 'init' ) )
    194                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    195                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     194                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     195                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    196196                $wp_scripts = new WP_Scripts();
    197197        }
    198198
     
    219219        global $wp_scripts;
    220220        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    221221                if ( ! did_action( 'init' ) )
    222                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    223                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     222                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     223                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    224224                $wp_scripts = new WP_Scripts();
    225225        }
    226226
     
    244244        global $wp_scripts;
    245245        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
    246246                if ( ! did_action( 'init' ) )
    247                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    248                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     247                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     248                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    249249                $wp_scripts = new WP_Scripts();
    250250        }
    251251
  • wp-includes/functions.wp-styles.php

     
    3333        global $wp_styles;
    3434        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    3535                if ( ! did_action( 'init' ) )
    36                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    37                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     36                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     37                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    3838
    3939                if ( !$handles )
    4040                        return array(); // No need to instantiate if nothing is there.
     
    6666        global $wp_styles;
    6767        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    6868                if ( ! did_action( 'init' ) )
    69                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    70                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     69                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     70                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    7171                $wp_styles = new WP_Styles();
    7272        }
    7373
     
    101101        global $wp_styles;
    102102        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    103103                if ( ! did_action( 'init' ) )
    104                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    105                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     104                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     105                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    106106                $wp_styles = new WP_Styles();
    107107        }
    108108
     
    123123        global $wp_styles;
    124124        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    125125                if ( ! did_action( 'init' ) )
    126                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    127                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     126                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     127                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    128128                $wp_styles = new WP_Styles();
    129129        }
    130130
     
    156156        global $wp_styles;
    157157        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    158158                if ( ! did_action( 'init' ) )
    159                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    160                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     159                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     160                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    161161                $wp_styles = new WP_Styles();
    162162        }
    163163
     
    182182        global $wp_styles;
    183183        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    184184                if ( ! did_action( 'init' ) )
    185                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    186                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     185                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     186                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    187187                $wp_styles = new WP_Styles();
    188188        }
    189189
     
    206206        global $wp_styles;
    207207        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
    208208                if ( ! did_action( 'init' ) )
    209                         _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    210                                 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     209                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Perpetrating Handle: %4$s.  Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     210                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>', '<code>'.esc_html($handle).'</code>' ), '3.3' );
    211211                $wp_styles = new WP_Styles();
    212212        }
    213213