get_theme_support

Gets the theme support arguments passed when registering that support.

Description

get_theme_support( (string) $feature ); 

Parameters (1)

0. $feature (string)
The feature to check

Usage

  1. if ( !function_exists( 'get_theme_support' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4. // the feature to check 
  5. $feature = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_theme_support($feature); 
  9.  

Defined (1)

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

/wp-includes/theme.php  
  1. function get_theme_support( $feature ) { 
  2. global $_wp_theme_features; 
  3. if ( ! isset( $_wp_theme_features[ $feature ] ) ) 
  4. return false; 
  5.  
  6. if ( func_num_args() <= 1 ) 
  7. return $_wp_theme_features[ $feature ]; 
  8.  
  9. $args = array_slice( func_get_args(), 1 ); 
  10. switch ( $feature ) { 
  11. case 'custom-logo' : 
  12. case 'custom-header' : 
  13. case 'custom-background' : 
  14. if ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) ) 
  15. return $_wp_theme_features[ $feature ][0][ $args[0] ]; 
  16. return false; 
  17.  
  18. default : 
  19. return $_wp_theme_features[ $feature ];