plugins_api_result filter-hookWP 2.7.0

Filters the Plugin Installation API response results.

Usage

add_filter( 'plugins_api_result', 'wp_kama_plugins_api_result_filter', 10, 3 );

/**
 * Function for `plugins_api_result` filter-hook.
 * 
 * @param object|WP_Error $res    Response object or WP_Error.
 * @param string          $action The type of information being requested from the Plugin Installation API.
 * @param object          $args   Plugin API arguments.
 *
 * @return object|WP_Error
 */
function wp_kama_plugins_api_result_filter( $res, $action, $args ){

	// filter...
	return $res;
}
$res(object|WP_Error)
Response object or WP_Error.
$action(string)
The type of information being requested from the Plugin Installation API.
$args(object)
Plugin API arguments.

Changelog

Since 2.7.0 Introduced.

Where the hook is called

plugins_api()
plugins_api_result
wp-admin/includes/plugin-install.php 234
return apply_filters( 'plugins_api_result', $res, $action, $args );

Where the hook is used in WordPress

Usage not found.