wp_prepare_themes_for_js

Filters the themes prepared for JavaScript, for themes.php.

Description

apply_filters( 'wp_prepare_themes_for_js', (array) $prepared_themes ); 

Could be useful for changing the order, which is by name by default.

Parameters (1)

0. $prepared_themes (array)
The prepared themes.

Usage

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

Defined (1)

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

/wp-admin/includes/theme.php  
  1. $prepared_themes = apply_filters( 'wp_prepare_themes_for_js', $prepared_themes );