themes_api_result

Filters the returned WordPress.org Themes API response.

Description

apply_filters( 'themes_api_result', (array|object|WP_Error) $res, (string) $action, (object) $args ); 

Parameters (3)

0. $res (array|object|WP_Error)
WordPress.org Themes API response.
1. $action (string)
Requested action. Likely values are theme_information,, feature_list., or query_themes.
2. $args (object)
Arguments used to query for installer pages from the WordPress.org Themes API.

Usage

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

Defined (1)

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

/wp-admin/includes/theme.php  
  1. return apply_filters( 'themes_api_result', $res, $action, $args );