WordPress.org

Make WordPress Core

Changeset 31708


Ignore:
Timestamp:
03/10/2015 11:19:02 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Revert the part of [31168] that [31701] was trying to fix.

default-filters.php is loaded before the $current_site global is set, so is_main_site() cannot be used there.

fixes #30947.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r31701 r31708  
    359359add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
    360360
    361 // Update
    362 if ( ( is_main_site() || is_network_admin() ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    363     add_action( 'admin_init',                '_maybe_update_core'              );
    364     add_action( 'wp_version_check',          'wp_version_check'                );
    365     add_action( 'upgrader_process_complete', 'wp_version_check',         10, 0 );
    366 
    367     add_action( 'load-plugins.php',          'wp_update_plugins'               );
    368     add_action( 'load-update.php',           'wp_update_plugins'               );
    369     add_action( 'load-update-core.php',      'wp_update_plugins'               );
    370     add_action( 'admin_init',                '_maybe_update_plugins'           );
    371     add_action( 'wp_update_plugins',         'wp_update_plugins'               );
    372     add_action( 'upgrader_process_complete', 'wp_update_plugins',        10, 0 );
    373 
    374     add_action( 'load-themes.php',           'wp_update_themes'                );
    375     add_action( 'load-update.php',           'wp_update_themes'                );
    376     add_action( 'load-update-core.php',      'wp_update_themes'                );
    377     add_action( 'admin_init',                '_maybe_update_themes'            );
    378     add_action( 'wp_update_themes',          'wp_update_themes'                );
    379     add_action( 'upgrader_process_complete', 'wp_update_themes',         10, 0 );
    380 
    381     add_action( 'update_option_WPLANG',      'wp_clean_update_cache',    10, 0 );
    382     add_action( 'wp_maybe_auto_update',      'wp_maybe_auto_update'            );
    383     add_action( 'init',                      'wp_schedule_update_checks'       );
    384 }
    385 
    386361// Canonical
    387362add_action( 'template_redirect', 'redirect_canonical' );
  • trunk/src/wp-includes/update.php

    r31701 r31708  
    664664    delete_site_transient( 'update_core' );
    665665}
     666
     667if ( ( ! is_main_site() && ! is_network_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
     668    return;
     669}
     670
     671add_action( 'admin_init', '_maybe_update_core' );
     672add_action( 'wp_version_check', 'wp_version_check' );
     673add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
     674
     675add_action( 'load-plugins.php', 'wp_update_plugins' );
     676add_action( 'load-update.php', 'wp_update_plugins' );
     677add_action( 'load-update-core.php', 'wp_update_plugins' );
     678add_action( 'admin_init', '_maybe_update_plugins' );
     679add_action( 'wp_update_plugins', 'wp_update_plugins' );
     680add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
     681
     682add_action( 'load-themes.php', 'wp_update_themes' );
     683add_action( 'load-update.php', 'wp_update_themes' );
     684add_action( 'load-update-core.php', 'wp_update_themes' );
     685add_action( 'admin_init', '_maybe_update_themes' );
     686add_action( 'wp_update_themes', 'wp_update_themes' );
     687add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
     688
     689add_action( 'update_option_WPLANG', 'wp_clean_update_cache' , 10, 0 );
     690
     691add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
     692
     693add_action( 'init', 'wp_schedule_update_checks' );
Note: See TracChangeset for help on using the changeset viewer.