Make WordPress Core

Ticket #22401: 22401.reindented.patch

File 22401.reindented.patch, 1.8 KB (added by slobodanmanic, 12 years ago)
  • wp-includes/default-filters.php

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

     
    706706        }
    707707
    708708        update_option( 'theme_switched', $old_theme->get_stylesheet() );
    709         do_action( 'switch_theme', $new_name, $new_theme );
     709        do_action( 'switch_theme', $new_name, $new_theme, $old_theme->get( 'Name' ), $old_theme );
    710710}
    711711
    712712/**
     
    16341634 *
    16351635 * @since 3.3.0
    16361636 */
    1637 function check_theme_switched() {
    1638         if ( $stylesheet = get_option( 'theme_switched' ) ) {
    1639                 $old_theme = wp_get_theme( $stylesheet );
    1640 
    1641                 if ( $old_theme->exists() )
    1642                         do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
    1643                 else
    1644                         do_action( 'after_switch_theme', $stylesheet );
    1645 
    1646                 update_option( 'theme_switched', false );
    1647         }
     1637function check_theme_switched( $new_name, $new_theme, $old_name, $old_theme ) {
     1638        if ( $old_theme->exists() )
     1639                do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
     1640        else
     1641                do_action( 'after_switch_theme', $old_name );
    16481642}
    16491643
    16501644/**