Theme_Upgrader::theme_info() WordPress Method

The Theme_Upgrader::theme_info() method is used to get information about a theme. This information includes the name, author, version, and description of the theme.

Theme_Upgrader::theme_info( string $theme = null ) #

Get the WP_Theme object for a theme.


Parameters

$theme

(string)(Optional)The directory name of the theme. This is optional, and if not supplied, the directory name from the last result will be used.

Default value: null


Top ↑

Return

(WP_Theme|false) The theme's info object, or false $theme is not supplied and the last result isn't set.


Top ↑

Source

File: wp-admin/includes/class-theme-upgrader.php

	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;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0The $theme argument was added.
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.