WordPress.org

Make WordPress Core

Ticket #11923: 11923.diff

File 11923.diff, 1.2 KB (added by scribu, 4 years ago)

second argument for wp_print_scripts() and wp_print_styles()

  • wp-includes/functions.wp-scripts.php

     
    1818 * @since r16 
    1919 * @see WP_Dependencies::print_scripts() 
    2020 */ 
    21 function wp_print_scripts( $handles = false ) { 
    22         do_action( 'wp_print_scripts' ); 
     21function wp_print_scripts( $handles = false, $do_action = true ) { 
     22        if ( $do_action ) 
     23                do_action( 'wp_print_scripts' ); 
     24 
    2325        if ( '' === $handles ) // for wp_head 
    2426                $handles = false; 
    2527 
  • wp-includes/functions.wp-styles.php

     
    1717 *  an array with one string prints that style, and an array of strings prints those styles. 
    1818 * @return bool True on success, false on failure. 
    1919 */ 
    20 function wp_print_styles( $handles = false ) { 
    21         do_action( 'wp_print_styles' ); 
     20function wp_print_styles( $handles = false, $do_action = true ) { 
     21        if ( $do_action ) 
     22                do_action( 'wp_print_styles' ); 
     23 
    2224        if ( '' === $handles ) // for wp_head 
    2325                $handles = false; 
    2426