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.

Built from https://develop.svn.wordpress.org/trunk@34647


git-svn-id: http://core.svn.wordpress.org/trunk@34611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2015-09-27 22:29:24 +00:00
parent e177565b03
commit ed719e4d32
2 changed files with 9 additions and 6 deletions

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 );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34646';
$wp_version = '4.4-alpha-34647';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.