WPDev.one
Core Class

WP_Theme

class WP_Theme // Constructor: function Object() { [native code] }

WP_Theme Class

Methods 52 methods

Method / Return Description
__construct()
void

Constructor for WP_Theme.

Parameters: $theme_dir: mixed, $theme_root: mixed, $_child: mixed
__toString()
string

When converting the object to a string, the theme name is returned.

__isset()
bool

__isset() magic method for properties formerly returned by current_theme_info()

Parameters: $offset: mixed
__get()
mixed

__get() magic method for properties formerly returned by current_theme_info()

Parameters: $offset: mixed
offsetSet()
void

Method to implement ArrayAccess for keys formerly returned by get_themes()

Parameters: $offset: mixed, $value: mixed
offsetUnset()
void

Method to implement ArrayAccess for keys formerly returned by get_themes()

Parameters: $offset: mixed
offsetExists()
bool

Method to implement ArrayAccess for keys formerly returned by get_themes()

Parameters: $offset: mixed
offsetGet()
mixed

Method to implement ArrayAccess for keys formerly returned by get_themes().

Parameters: $offset: mixed
errors()
(WP_Error

Returns errors property.

exists()
bool

Determines whether the theme exists.

parent()
(WP_Theme

Returns reference to the parent theme.

__wakeup()
void

Perform reinitialization tasks.

cache_add()
bool

Adds theme data to cache.

Parameters: $key: mixed, $data: mixed
cache_get()
mixed

Gets theme data from cache.

Parameters: $key: mixed
cache_delete()
void

Clears the cache for the theme.

get()
(string

Gets a raw, unformatted theme header.

Parameters: $header: mixed
display()
(string

Gets a theme header, formatted and translated for display.

Parameters: $header: mixed, $markup: mixed, $translate: mixed
sanitize_header()
(string

Sanitizes a theme header.

Parameters: $header: mixed, $value: mixed
markup_header()
string

Marks up a theme header.

Parameters: $header: mixed, $value: mixed, $translate: mixed
translate_header()
(string

Translates a theme header.

Parameters: $header: mixed, $value: mixed
get_stylesheet()
string

Returns the directory name of the theme's "stylesheet" files, inside the theme root.

get_template()
string

Returns the directory name of the theme's "template" files, inside the theme root.

get_stylesheet_directory()
string

Returns the absolute path to the directory of a theme's "stylesheet" files.

get_template_directory()
string

Returns the absolute path to the directory of a theme's "template" files.

get_stylesheet_directory_uri()
string

Returns the URL to the directory of a theme's "stylesheet" files.

get_template_directory_uri()
string

Returns the URL to the directory of a theme's "template" files.

get_theme_root()
string

Returns the absolute path to the directory of the theme root.

get_theme_root_uri()
string

Returns the URL to the directory of the theme root.

get_screenshot()
(string

Returns the main screenshot file for the theme.

Parameters: $uri: mixed
get_files()
string[]

Returns files in the theme's directory.

Parameters: $type: mixed, $depth: mixed, $search_parent: mixed
get_post_templates()
array[]

Returns the theme's post templates.

get_page_templates()
string[]

Returns the theme's post templates for a given post type.

Parameters: $post: mixed, $post_type: mixed
scandir()
(string[]

Scans a directory for files of a certain extension.

Parameters: $path: mixed, $extensions: mixed, $depth: mixed, $relative_path: mixed
load_textdomain()
bool

Loads the theme's textdomain.

is_allowed()
bool

Determines whether the theme is allowed (multisite only).

Parameters: $check: mixed, $blog_id: mixed
is_block_theme()
bool

Returns whether this theme is a block-based theme or not.

get_file_path()
string

Retrieves the path of a file in the theme.

Parameters: $file: mixed
get_core_default_theme()
(WP_Theme

Determines the latest WordPress default theme that is installed.

get_allowed()
string[]

Returns array of stylesheet names of themes allowed on the site or network.

Parameters: $blog_id: mixed
get_allowed_on_network()
string[]

Returns array of stylesheet names of themes allowed on the network.

get_allowed_on_site()
string[]

Returns array of stylesheet names of themes allowed on the site.

Parameters: $blog_id: mixed
get_block_template_folders()
string[]

Returns the folder names of the block template directories.

get_block_patterns()
array

Gets block pattern data for a specified theme.

get_pattern_cache()
(array

Gets block pattern cache.

set_pattern_cache()
void

Sets block pattern cache.

Parameters: $patterns: array
delete_pattern_cache()
void

Clears block pattern cache.

network_enable_theme()
void

Enables a theme for all sites on the current network.

Parameters: $stylesheets: mixed
network_disable_theme()
void

Disables a theme for all sites on the current network.

Parameters: $stylesheets: mixed
sort_by_name()
void

Sorts themes by name.

Parameters: $themes: mixed
_name_sort()
int

Callback function for usort() to naturally sort themes by name.

Parameters: $a: mixed, $b: mixed
_name_sort_i18n()
int

Callback function for usort() to naturally sort themes by translated name.

Parameters: $a: mixed, $b: mixed
_check_headers_property_has_correct_type()
void

No description available.

Parameters: $headers: mixed

Properties

Property / Type Description
$update
mixed
public
No description available.
$file_headers
mixed
public
No description available.
$default_themes
mixed
public
No description available.
$tag_map
mixed
public
No description available.
$theme_root
mixed
public
No description available.
$headers
mixed
public
No description available.
$headers_sanitized
mixed
public
No description available.
$block_theme
mixed
public
No description available.
$name_translated
mixed
public
No description available.
$errors
mixed
public
No description available.
$stylesheet
mixed
public
No description available.
$template
mixed
public
No description available.
$parent
mixed
public
No description available.
$theme_root_uri
mixed
public
No description available.
$textdomain_loaded
mixed
public
No description available.
$cache_hash
mixed
public
No description available.
$block_template_folders
mixed
public
No description available.
$default_template_folders
mixed
public
No description available.
$persistently_cache
mixed
public
No description available.
$cache_expiration
mixed
public
No description available.

Class Information

Since Version
3.4.0
Source File
wp-includes/class-wp-theme.php
Advertisement