Make WordPress Core

Ticket #20334: 20334.patch

File 20334.patch, 780 bytes (added by johnjamesjacoby, 14 years ago)
  • wp-includes/theme.php

     
    15521552 */
    15531553function check_theme_switched() {
    15541554        if ( $stylesheet = get_option( 'theme_switched' ) ) {
    1555                 $old_theme = wp_get_theme( $stylesheet );
     1555                if ( $old_theme = wp_get_theme( $stylesheet ) ) {
     1556                        if ( $old_theme->exists() ) {
     1557                                do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
     1558                        } else {
     1559                                do_action( 'after_switch_theme', $stylesheet );
     1560                        }
    15561561
    1557                 if ( $old_theme->exists() )
    1558                         do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
    1559                 else
    1560                         do_action( 'after_switch_theme', $stylesheet );
    1561 
    1562                 update_option( 'theme_switched', false );
     1562                        update_option( 'theme_switched', false );
     1563                }
    15631564        }
    15641565}
    15651566