wp_print_scripts

The WordPress Core wp print scripts hook.

Description

add_filter( 'wp_print_scripts', (string) $wp_just_in_time_script_localization ); 

Parameters (1)

0. $wp_just_in_time_script_localization (string) => 'wp_just_in_time_script_localization'
The wp just in time script localization.

Usage

To run the hook, copy the example below.
  1. $wp_just_in_time_script_localization = apply_filters( 'wp_print_scripts', $wp_just_in_time_script_localization ); 
  2.  
  3. if ( !empty( $wp_just_in_time_script_localization ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_print_scripts callback 
  2. function filter_wp_print_scripts( $wp_just_in_time_script_localization ) { 
  3. // make filter magic happen here... 
  4. return $wp_just_in_time_script_localization
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_print_scripts', 'filter_wp_print_scripts', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_print_scripts', 'filter_wp_print_scripts', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/default-filters.php  
  1. add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );