WordPress.org

Make WordPress Core

Ticket #22401: 22401.patch

File 22401.patch, 1.7 KB (added by evansolomon, 6 years ago)
  • wp-includes/default-filters.php

     
    211211add_action( 'wp_head',             'wp_shortlink_wp_head',            10, 0 );
    212212add_action( 'template_redirect',   'wp_shortlink_header',             11, 0 );
    213213add_action( 'wp_print_footer_scripts', '_wp_footer_scripts'                 );
    214 add_action( 'init',                'check_theme_switched',            99    );
     214add_action( 'switch_theme',        'check_theme_switched',            99, 4 );
    215215add_action( 'after_switch_theme',  '_wp_sidebars_changed'                   );
    216216
    217217if ( isset( $_GET['replytocom'] ) )
  • wp-includes/theme.php

     
    694694        }
    695695
    696696        update_option( 'theme_switched', $old_theme->get_stylesheet() );
    697         do_action( 'switch_theme', $new_name, $new_theme );
     697        do_action( 'switch_theme', $new_name, $new_theme, $old_theme->get( 'Name' ), $old_theme );
    698698}
    699699
    700700/**
     
    15991599 *
    16001600 * @since 3.3.0
    16011601 */
    1602 function check_theme_switched() {
    1603         if ( $stylesheet = get_option( 'theme_switched' ) ) {
    1604                 $old_theme = wp_get_theme( $stylesheet );
    1605 
     1602function check_theme_switched( $new_name, $new_theme, $old_name, $old_theme ) {
    16061603                if ( $old_theme->exists() )
    16071604                        do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
    16081605                else
    1609                         do_action( 'after_switch_theme', $stylesheet );
    1610 
    1611                 update_option( 'theme_switched', false );
    1612         }
     1606                        do_action( 'after_switch_theme', $old_name );
    16131607}
    16141608
    16151609/**