themes_api ( $action, $args = array() )

  • (string) $action API action to perform: 'query_themes', 'theme_information', 'hot_tags' or 'feature_list'.
  • (array|object) $args { Optional. Array or object of arguments to serialize for the Themes API.
  • (object|array|WP_Error) Response object or array on success, WP_Error on failure. See the {@link function reference article} for more information on the make-up of possible return objects depending on the value of `$action`.
Defined at:


Retrieves theme installer pages from the Themes API.

It is possible for a theme to override the Themes API result with three filters. Assume this is for themes, which can extend on the Theme Info to offer more choices. This is very powerful and must be used with care, when overriding the filters.

The first filter, {@see 'themes_api_args'}, is for the args and gives the action as the second parameter. The hook for {@see 'themes_api_args'} must ensure that an object is returned.

The second filter, {@see 'themes_api'}, allows a plugin to override the Theme API entirely. 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.

Finally, the third filter, {@see 'themes_api_result'}, makes it possible to filter the response object or array, depending on the $action type.

Supported arguments per action:

Argument Name 'query_themes' 'theme_information' 'hot_tags' 'feature_list'
$slug No Yes No No
$per_page Yes No No No
$page Yes No No No
$number No No Yes No
$search Yes No No No
$tag Yes No No No
$author Yes No No No
$user Yes No No No
$browse Yes No No No
$locale Yes Yes No No
$fields Yes Yes No No

Related Functions

the_meta, the_id, get_themes, get_theme_data, add_theme_page

Top Google Results

User discussions

wpseek mobile