mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +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) )
|
if ( !isset($args->per_page) )
|
||||||
$args->per_page = 24;
|
$args->per_page = 24;
|
||||||
|
|
||||||
// Allows a plugin to override the WordPress.org API entirely.
|
/**
|
||||||
// Use the filter 'plugins_api_result' to merely add results.
|
* Override the Plugin Install API arguments.
|
||||||
// Please ensure that a object is returned from the following filters.
|
*
|
||||||
|
* 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 );
|
$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 );
|
$res = apply_filters( 'plugins_api', false, $action, $args );
|
||||||
|
|
||||||
if ( false === $res ) {
|
if ( false === $res ) {
|
||||||
@ -64,6 +83,15 @@ function plugins_api($action, $args = null) {
|
|||||||
$res->external = true;
|
$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 );
|
return apply_filters( 'plugins_api_result', $res, $action, $args );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user