Changeset 25961
- Timestamp:
- 10/27/2013 10:45:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/theme.php
r25956 r25961 267 267 * @since 2.8.0 268 268 * 269 * @param string $action 270 * @param array|object $args Optional. Arguments to serialize for the Theme Info API. 269 * @param string $action The requested action. Likely values are 'theme_information', 270 * 'feature_list', or 'query_themes'. 271 * @param array|object $args Optional. Arguments to serialize for the Theme Info API. 271 272 * @return mixed 272 273 */ 273 function themes_api( $action, $args = null) {274 function themes_api( $action, $args = null ) { 274 275 275 276 if ( is_array($args) ) … … 278 279 if ( !isset($args->per_page) ) 279 280 $args->per_page = 24; 280 281 $args = apply_filters('themes_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter. 282 $res = apply_filters('themes_api', false, $action, $args); //NOTE: Allows a theme to completely override the builtin WordPress.org API. 281 /** 282 * Filter arguments used to query for installer pages from the WordPress.org Themes API. 283 * 284 * Important: An object MUST be returned to this filter. 285 * 286 * @since 2.8.0 287 * 288 * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API. 289 * @param string $action Requested action. Likely values are 'theme_information', 290 * 'feature_list', or 'query_themes'. 291 */ 292 $args = apply_filters( 'themes_api_args', $args, $action ); 293 294 /** 295 * Filter whether to override the WordPress.org Themes API. 296 * 297 * Returning a value of true to this filter allows a theme to completely 298 * override the built-in WordPress.org API. 299 * 300 * @since 2.8.0 301 * 302 * @param bool $bool Whether to override the WordPress.org Themes API. Default false. 303 * @param string $action Requested action. Likely values are 'theme_information', 304 * 'feature_list', or 'query_themes'. 305 * @param object $args Arguments used to query for installer pages from the Themes API. 306 */ 307 $res = apply_filters( 'themes_api', false, $action, $args ); 283 308 284 309 if ( ! $res ) { … … 309 334 } 310 335 311 return apply_filters('themes_api_result', $res, $action, $args); 312 } 336 /** 337 * Filter the returned WordPress.org Themes API response. 338 * 339 * @since 2.8.0 340 * 341 * @param array|object $res WordPress.org Themes API response. 342 * @param string $action Requested action. Likely values are 'theme_information', 343 * 'feature_list', or 'query_themes'. 344 * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API. 345 */ 346 return apply_filters( 'themes_api_result', $res, $action, $args ); 347 }
Note: See TracChangeset
for help on using the changeset viewer.