Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // If you're a host, and you have a plugin installed on every site,
- // either of the below hotfixes will allow WordPress 4.9.3 to update to 4.9.4.
- // Option 1:
- // Fix the dependancies before the fatal is encountered:
- add_action( 'set_site_transient_update_core', function( $val ) {
- global $wp_version;
- if ( wp_doing_cron() && '4.9.3' == $wp_version && !empty( $val->updates ) ) {
- include ABSPATH . 'wp-admin/includes/admin.php';
- }
- } );
- // Option 2:
- // Queue a "once-off" autoupdate cron task - as this calls wp_maybe_auto_update() direcly, it works as expected.
- // It'll get requeued as long as the install is on 4.9.3.
- // Calling `wp_maybe_auto_update()` directly is also enough.
- add_action( 'init', function() {
- global $wp_version;
- if ( $wp_version == '4.9.3' && ! wp_next_scheduled( 'wp_maybe_auto_update' ) ) {
- // Schedule it for in 12hr so that it only runs every 12hrs (and doens't overload this server with requests)
- wp_schedule_single_event( time() + 12 * HOUR_IN_SECONDS, 'wp_maybe_auto_update' );
- }
- } );
Add Comment
Please, Sign In to add comment