Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




check_theme_switched [ WordPress Function ]

check_theme_switched ( No parameters )
Defined at:



Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load

Source


<?php
function check_theme_switched() {
    if ( 
$stylesheet get_option'theme_switched' ) ) {
        
$old_theme wp_get_theme$stylesheet );

        if ( 
$old_theme->exists() )
            
do_action'after_switch_theme'$old_theme->get('Name'), $old_theme );
        else
            
do_action'after_switch_theme'$stylesheet );

        
update_option'theme_switched'false );
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics