From df542a1802aad48773f26e0eb4496f9c6b262aba Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 27 Sep 2015 23:00:08 +0000 Subject: [PATCH] Docs: Improve the hook documentation for the `themes_api` filter. Standardizes the hook doc summary and expands on expected behavior when short-circuiting the request, which is dependent on the `$action` type. Also updates the expected types on the `$override` parameter. See #34036. See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@34651 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 132b815d58..c4b8b0c3bf 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -406,15 +406,17 @@ function themes_api( $action, $args = array() ) { /** * Filter whether to override the WordPress.org Themes API. * - * Returning a value of true to this filter allows a theme to completely - * override the built-in WordPress.org API. + * Passing a non-false value will effectively short-circuit the WordPress.org API request. + * + * If `$action` is 'query_themes', 'theme_information', or 'feature_list', an object MUST + * be passed. If `$action` is 'hot_tags`, an array should be passed. * * @since 2.8.0 * - * @param bool $bool Whether to override the WordPress.org Themes API. Default false. - * @param string $action Requested action. Likely values are 'theme_information', - * 'feature_list', or 'query_themes'. - * @param object $args Arguments used to query for installer pages from the Themes API. + * @param false|object|array $override Whether to override the WordPress.org Themes API. Default false. + * @param string $action Requested action. Likely values are 'theme_information', + * 'feature_list', or 'query_themes'. + * @param object $args Arguments used to query for installer pages from the Themes API. */ $res = apply_filters( 'themes_api', false, $action, $args );