Returns reference to the parent theme.
Source
public function parent() {
return isset( $this->parent ) ? $this->parent : false;
}
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
| CARVIEW |
Returns reference to the parent theme.
public function parent() {
return isset( $this->parent ) ? $this->parent : false;
}
| Used by | Description |
|---|---|
WP_Theme_JSON_Resolver::get_theme_data()wp-includes/class-wp-theme-json-resolver.php | Returns the theme’s data. |
WP_Theme::get_template_directory()wp-includes/class-wp-theme.php | Returns the absolute path to the directory of a theme’s “template” files. |
WP_Theme::get_template_directory_uri()wp-includes/class-wp-theme.php | Returns the URL to the directory of a theme’s “template” files. |
WP_Theme::get_files()wp-includes/class-wp-theme.php | Returns files in the theme’s directory. |
WP_Theme::__get()wp-includes/class-wp-theme.php | __get() magic method for properties formerly returned by current_theme_info() |
WP_Theme::offsetGet()wp-includes/class-wp-theme.php |
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Beware: this variable is untrimmed. This means that if you look through wp_get_themes() and do something like
wp_get_theme()->parent() === $theme->get( 'Name' )that it may always returnFALSEbecause there’s untrimmed whitespace being returned byparent(). If you dotrim( wp_get_theme()->parent() ) === $theme->get( 'Name' )the result will be as expected.