Inline documentation for hooks in wp-admin/includes/theme.php.

Props l10n for the initial patch.
Fixes #25732.


git-svn-id: https://develop.svn.wordpress.org/trunk@25961 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2013-10-27 22:45:32 +00:00
parent 06635ed4cd
commit 3a26e383ae

View File

@ -266,7 +266,8 @@ function get_theme_feature_list( $api = true ) {
* *
* @since 2.8.0 * @since 2.8.0
* *
* @param string $action * @param string $action The requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
* @param array|object $args Optional. Arguments to serialize for the Theme Info API. * @param array|object $args Optional. Arguments to serialize for the Theme Info API.
* @return mixed * @return mixed
*/ */
@ -277,9 +278,33 @@ function themes_api($action, $args = null) {
if ( !isset($args->per_page) ) if ( !isset($args->per_page) )
$args->per_page = 24; $args->per_page = 24;
/**
* Filter arguments used to query for installer pages from the WordPress.org Themes API.
*
* Important: An object MUST be returned to this filter.
*
* @since 2.8.0
*
* @param object $args Arguments used to query for installer pages from the WordPress.org Themes API.
* @param string $action Requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
*/
$args = apply_filters( 'themes_api_args', $args, $action );
$args = apply_filters('themes_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter. /**
$res = apply_filters('themes_api', false, $action, $args); //NOTE: Allows a theme to completely override the builtin WordPress.org API. * 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.
*
* @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.
*/
$res = apply_filters( 'themes_api', false, $action, $args );
if ( ! $res ) { if ( ! $res ) {
$url = $http_url = 'http://api.wordpress.org/themes/info/1.0/'; $url = $http_url = 'http://api.wordpress.org/themes/info/1.0/';
@ -308,5 +333,15 @@ function themes_api($action, $args = null) {
} }
} }
/**
* Filter the returned WordPress.org Themes API response.
*
* @since 2.8.0
*
* @param array|object $res WordPress.org Themes API response.
* @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 WordPress.org Themes API.
*/
return apply_filters( 'themes_api_result', $res, $action, $args ); return apply_filters( 'themes_api_result', $res, $action, $args );
} }