37 | | // Allows a plugin to override the WordPress.org API entirely. |
38 | | // Use the filter 'plugins_api_result' to merely add results. |
39 | | // Please ensure that a object is returned from the following filters. |
40 | | $args = apply_filters('plugins_api_args', $args, $action); |
41 | | $res = apply_filters('plugins_api', false, $action, $args); |
| 37 | /** |
| 38 | * Override the Plugin API arguments. |
| 39 | * |
| 40 | * Please ensure that an object is returned. |
| 41 | * |
| 42 | * @since 2.7.0 |
| 43 | * |
| 44 | * @param object $args Plugin API arguments. |
| 45 | * @param string $action The type of information being requested from the Plugin API. |
| 46 | */ |
| 47 | $args = apply_filters( 'plugins_api_args', $args, $action ); |
| 48 | |
| 49 | /** |
| 50 | * Allows a plugin to override the WordPress.org API entirely. |
| 51 | * |
| 52 | * Please ensure that an object is returned. |
| 53 | * |
| 54 | * @since 2.7.0 |
| 55 | * |
| 56 | * @param bool|object The result object. Default is false. |
| 57 | * @param string $action The type of information being requested from the Plugin API. |
| 58 | * @param object $args Plugin API arguments. |
| 59 | */ |
| 60 | $res = apply_filters( 'plugins_api', false, $action, $args ); |
67 | | return apply_filters('plugins_api_result', $res, $action, $args); |
| 86 | /** |
| 87 | * Add a result to the Plugin API response. |
| 88 | * |
| 89 | * @since 2.7.0 |
| 90 | * |
| 91 | * @param object $res Response object or WP_Error. |
| 92 | * @param string $action The type of information being requested from the Plugin API. |
| 93 | * @param object $args Plugin API arguments. |
| 94 | */ |
| 95 | return apply_filters( 'plugins_api_result', $res, $action, $args ); |