Make WordPress Core

Changeset 20330


Ignore:
Timestamp:
03/30/2012 03:13:12 PM (14 years ago)
Author:
westi
Message:

Avoid fatal errors in check_theme_switched() if we fail to get a WP_Theme object for the old theme. Fixes #20334.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r20328 r20330  
    15561556        if ( $stylesheet = get_option( 'theme_switched' ) ) {
    15571557                $old_theme = wp_get_theme( $stylesheet );
    1558                 do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
     1558
     1559                // If we can't find the old theme then fallback to passing the raw data to the action like we did pre-3.4
     1560                if ( $old_theme )
     1561                        do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
     1562                else
     1563                        do_action( 'after_switch_theme', $stylesheet );
     1564
    15591565                update_option( 'theme_switched', false );
    15601566        }
Note: See TracChangeset for help on using the changeset viewer.