get_theme

Retrieve theme data.

Description

(array|null) get_theme( (string) $theme ); 

Returns (array|null)

Null, if theme name does not exist. Theme data, if exists.

Parameters (1)

0. $theme (string)
Theme name.

Usage

  1. if ( !function_exists( 'get_theme' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // Theme name. 
  5. $theme = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_theme($theme); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function get_theme( $theme ) { 
  2. _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme( $stylesheet )' ); 
  3.  
  4. $themes = get_themes(); 
  5. if ( is_array( $themes ) && array_key_exists( $theme, $themes ) ) 
  6. return $themes[ $theme ]; 
  7. return null;