Theme_Upgrader::theme_info()
Gets the WP_Theme object for a theme.
Method of the class: Theme_Upgrader{}
No Hooks.
Return
WP_Theme|false
. The theme's info object, or false $theme is not supplied and the last result isn't set.
Usage
$Theme_Upgrader = new Theme_Upgrader(); $Theme_Upgrader->theme_info( $theme );
- $theme(string)
- The directory name of the theme. This is optional, and if not supplied, the directory name from the last result will be used.
Default: null
Changelog
Since 2.8.0 | Introduced. |
Since 3.0.0 | The $theme argument was added. |
Theme_Upgrader::theme_info() Theme Upgrader::theme info code WP 6.7.1
public function theme_info( $theme = null ) { if ( empty( $theme ) ) { if ( ! empty( $this->result['destination_name'] ) ) { $theme = $this->result['destination_name']; } else { return false; } } $theme = wp_get_theme( $theme ); $theme->cache_delete(); return $theme; }