mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Inline documentation for hooks in wp-admin/includes/plugin-install.php.
Props naomicbush. See #25229. Built from https://develop.svn.wordpress.org/trunk@25511 git-svn-id: http://core.svn.wordpress.org/trunk@25431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f1dfbc6e80
commit
11080f459c
@ -34,10 +34,29 @@ function plugins_api($action, $args = null) {
|
||||
if ( !isset($args->per_page) )
|
||||
$args->per_page = 24;
|
||||
|
||||
// Allows a plugin to override the WordPress.org API entirely.
|
||||
// Use the filter 'plugins_api_result' to merely add results.
|
||||
// Please ensure that a object is returned from the following filters.
|
||||
/**
|
||||
* Override the Plugin Install API arguments.
|
||||
*
|
||||
* Please ensure that an object is returned.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $args Plugin API arguments.
|
||||
* @param string $action The type of information being requested from the Plugin Install API.
|
||||
*/
|
||||
$args = apply_filters( 'plugins_api_args', $args, $action );
|
||||
|
||||
/**
|
||||
* Allows a plugin to override the WordPress.org Plugin Install API entirely.
|
||||
*
|
||||
* Please ensure that an object is returned.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param bool|object The result object. Default is 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 );
|
||||
|
||||
if ( false === $res ) {
|
||||
@ -64,6 +83,15 @@ function plugins_api($action, $args = null) {
|
||||
$res->external = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the Plugin Install API response results.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object|WP_Error $res Response object or WP_Error.
|
||||
* @param string $action The type of information being requested from the Plugin Install API.
|
||||
* @param object $args Plugin API arguments.
|
||||
*/
|
||||
return apply_filters( 'plugins_api_result', $res, $action, $args );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user