Docs: Improve the hook documentation for the plugins_api filter.

Standardizes the hook doc summary and expands on expected behavior when short-circuiting the request, which is dependent on the `$action` type.

See #34035. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34647 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2015-09-27 22:28:38 +00:00
parent cb66358b9b
commit c82483fcbc

View File

@ -125,15 +125,18 @@ function plugins_api( $action, $args = array() ) {
$args = apply_filters( 'plugins_api_args', $args, $action );
/**
* Allows a plugin to override the WordPress.org Plugin Install API entirely.
* Filter the response for the current WordPress.org Plugin Install API request.
*
* Please ensure that an object is returned.
* Passing a non-false value will effectively short-circuit the WordPress.org API request.
*
* If `$action` is 'query_plugins', 'plugin_information', or 'hot_categories', an object MUST
* be passed. If `$action` is 'hot_tags`, an array should be passed.
*
* @since 2.7.0
*
* @param bool|object $result The result object. Default false.
* @param string $action The type of information being requested from the Plugin Install API.
* @param object $args Plugin API arguments.
* @param false|object|array $result The result object or array. Default false.
* @param string $action The type of information being requested from the Plugin Install API.
* @param object $args Plugin API arguments.
*/
$res = apply_filters( 'plugins_api', false, $action, $args );