[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/includes/ -> theme.php (summary)

WordPress Theme Administration API

File Size: 770 lines (30 kb)
Included or required: 4 times
Referenced: 0 times
Includes or requires: 2 files
 wp-admin/admin-header.php
 wp-admin/admin-footer.php

Defines 9 functions

  delete_theme()
  get_page_templates()
  _get_template_edit_filename()
  theme_update_available()
  get_theme_update_available()
  get_theme_feature_list()
  themes_api()
  wp_prepare_themes_for_js()
  customize_themes_print_templates()

Functions
Functions that are not part of a class:

delete_theme( $stylesheet, $redirect = '' )   X-Ref
Remove a theme

return: bool|null|WP_Error True on success, false if `$stylesheet` is empty, WP_Error on failure.
param: string $stylesheet Stylesheet of the theme to delete.
param: string $redirect   Redirect to page when complete.

get_page_templates( $post = null, $post_type = 'page' )   X-Ref
Get the Page Templates available in this theme

return: array Key is the template name, value is the filename of the template
param: WP_Post|null $post      Optional. The post being edited, provided for context.
param: string       $post_type Optional. Post type to get the templates for. Default 'page'.

_get_template_edit_filename( $fullpath, $containingfolder )   X-Ref
Tidies a filename for url display by the theme editor.

return: string
param: string $fullpath Full path to the theme file
param: string $containingfolder Path of the theme parent folder

theme_update_available( $theme )   X-Ref
Check if there is an update for a theme available.

Will display link, if there is an update available.

param: WP_Theme $theme Theme data object.

get_theme_update_available( $theme )   X-Ref
Retrieve the update link if there is a theme update available.

Will return a link if there is an update available.

return: false|string HTML for the update link, or false if invalid info was passed.
param: WP_Theme $theme WP_Theme object.

get_theme_feature_list( $api = true )   X-Ref
Retrieve list of WordPress theme features (aka theme tags).

return: array Array of features keyed by category with translations keyed by slug.
param: bool $api Optional. Whether try to fetch tags from the WordPress.org API. Defaults to true.

themes_api( $action, $args = array()   X-Ref
Retrieves theme installer pages from the WordPress.org 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 WordPress.org
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               |

return: object|array|WP_Error Response object or array on success, WP_Error on failure. See the
param: string       $action API action to perform: 'query_themes', 'theme_information',
param: array|object $args   {

wp_prepare_themes_for_js( $themes = null )   X-Ref
Prepare themes for JavaScript.

return: array An associative array of theme data, sorted by name.
param: WP_Theme[] $themes Optional. Array of theme objects to prepare.

customize_themes_print_templates()   X-Ref
Print JS templates for the theme-browsing UI in the Customizer.




Generated: Sat Feb 16 08:20:01 2019 Cross-referenced by PHPXref 0.7