Definition:
function add_theme_support( $feature ) {}
Allows a theme to register its support of a certain feature
Must be called in the theme’s functions.php file to work. If attached to a hook, it must be after_setup_theme. The init hook may be too late for some features.
Parameters
- string $feature: the feature being added
Source code
function add_theme_support( $feature ) {
global $_wp_theme_features;
if ( func_num_args() == 1 )
$_wp_theme_features[$feature] = true;
else
$_wp_theme_features[$feature] = array_slice( func_get_args(), 1 );
if ( $feature == 'post-formats' && is_array( $_wp_theme_features[$feature][0] ) )
$_wp_theme_features[$feature][0] = array_intersect( $_wp_theme_features[$feature][0], array_keys( get_post_format_slugs() ) );
}
373

February 11, 2011 


No comments yet... Be the first to leave a reply!