WordPress.org

Make WordPress Core

Ticket #8590: 8590-hooks.diff

File 8590-hooks.diff, 1.3 KB (added by Denis-de-Bernardy, 6 years ago)
  • wp-includes/update.php

     
    283283        wp_update_themes( ); 
    284284} 
    285285 
    286 add_action( 'init', '_maybe_update_core' ); 
     286if ( is_admin() ) { 
     287        add_action( 'admin_init', '_maybe_update_core' ); 
     288        add_action( 'admin_init', '_maybe_update_plugins' ); 
     289        add_action( 'admin_init', '_maybe_update_themes' ); 
     290} else { 
     291        add_action( 'shutdown', '_maybe_update_core', 1 ); 
     292        add_action( 'shutdown', '_maybe_update_plugins', 1 ); 
     293        add_action( 'shutdown', '_maybe_update_themes', 1 ); 
     294} 
    287295 
    288296add_action( 'load-plugins.php', 'wp_update_plugins' ); 
    289297add_action( 'load-update.php', 'wp_update_plugins' ); 
    290 add_action( 'admin_init', '_maybe_update_plugins' ); 
    291298add_action( 'wp_update_plugins', 'wp_update_plugins' ); 
    292299 
    293300add_action( 'load-themes.php', 'wp_update_themes' ); 
    294301add_action( 'load-update.php', 'wp_update_themes' ); 
    295 add_action( 'admin_init', '_maybe_update_themes' ); 
    296302add_action( 'wp_update_themes', 'wp_update_themes' ); 
    297303 
    298304if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') ) 
     
    302308if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') ) 
    303309        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes'); 
    304310 
    305 ?> 
     311?> 
     312 No newline at end of file