Skip to content

Commit

Permalink
Delay automatic updates after installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
costdev committed Jun 15, 2024
1 parent 738c03d commit d31f613
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ function wp_install( $blog_title, $user_name, $user_email, $is_public, $deprecat
wp_check_mysql_version();
wp_cache_flush();
make_db_current_silent();

/*
* Ensure update checks are delayed after installation.
*
* This prevents users being presented with a maintenance mode screen
* immediately after installation.
*/
wp_unschedule_hook( 'wp_version_check' );
wp_unschedule_hook( 'wp_update_plugins' );
wp_unschedule_hook( 'wp_update_themes' );

wp_schedule_event( time() + HOUR_IN_SECONDS, 'twicedaily', 'wp_version_check' );
wp_schedule_event( time() + ( 1.5 * HOUR_IN_SECONDS ), 'twicedaily', 'wp_update_plugins' );
wp_schedule_event( time() + ( 2 * HOUR_IN_SECONDS ), 'twicedaily', 'wp_update_themes' );

populate_options();
populate_roles();

Expand Down

0 comments on commit d31f613

Please sign in to comment.