Definition:
function get_current_theme() {}
Retrieve current theme display name.
If the ‘current_theme’ option has already been set, then it will be returned instead. If it is not set, then each theme will be iterated over until both the current stylesheet and current template name.
Source code
function get_current_theme() { if ( $theme = get_option('current_theme') ) return $theme; $themes = get_themes(); $current_theme = 'Twenty Eleven'; if ( $themes ) { $theme_names = array_keys( $themes ); $current_template = get_option( 'template' ); $current_stylesheet = get_option( 'stylesheet' ); foreach ( (array) $theme_names as $theme_name ) { if ( $themes[$theme_name]['Stylesheet'] == $current_stylesheet && $themes[$theme_name]['Template'] == $current_template ) { $current_theme = $themes[$theme_name]['Name']; break; } } } update_option('current_theme', $current_theme); return $current_theme; }
1344
No comments yet... Be the first to leave a reply!