Title: Theme_Upgrader::theme_info
Published: April 25, 2014
Last modified: February 24, 2026

---

# Theme_Upgrader::theme_info( string $theme = null ): 󠀁[WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/)󠁿|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#wp--skip-link--target)

Gets the [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/)
object for a theme.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#parameters)󠁿

 `$theme`stringoptional

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`

## 󠀁[Return](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#return)󠁿

 [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/)|false The
theme’s info object, or false `$theme` is not supplied and the last result isn’t
set.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-theme-upgrader.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/class-theme-upgrader.php#L790)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-theme-upgrader.php#L790-L803)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_theme()](https://developer.wordpress.org/reference/functions/wp_get_theme/)`wp-includes/theme.php` |

Gets a [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/) object for a theme.

  |

| Used by | Description | 
| [Theme_Upgrader::check_parent_theme_filter()](https://developer.wordpress.org/reference/classes/theme_upgrader/check_parent_theme_filter/)`wp-admin/includes/class-theme-upgrader.php` |

Checks if a child theme is being installed and its parent also needs to be installed.

  | 
| [Theme_Upgrader::bulk_upgrade()](https://developer.wordpress.org/reference/classes/theme_upgrader/bulk_upgrade/)`wp-admin/includes/class-theme-upgrader.php` |

Upgrades several themes at once.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | The `$theme` argument was added. | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Ftheme_upgrader%2Ftheme_info%2F)
before being able to contribute a note or feedback.