WordPress 5.6 New Features: New UI for Auto-Updates

WordPress 5.6 New Features: New UI for Auto-Updates

WordPress 5.6 New Features: New UI for Auto-Updates

WordPress 5.6 introduces a new UI to allow website administrators to opt-in to major versions automatic updates.

This feature follows plugins and themes auto-updates user interface which was shipped in WordPress 5.5. Both are part of the 9 WordPress Core projects for 2019-2020.


How does it look?

The core auto-updates feature already exists for years in WordPress. WP 5.6 only introduces a new user interface to make it easier to opt-in to automatic updates for major versions.

By default, WordPress auto-updates itself, but only for minor releases. Developers can already opt-in to major releases auto-updates by setting up the existing WP_AUTO_UPDATE_CORE constant to true or by using the allow_major_auto_core_updates existing filter.

With WordPress 5.6, it’s possible for website administrators to opt-in/out to automatic updates for major versions, using a specific interface located on the Updates screen:

WordPress 5.6 - welcome guide


How does it work?

This settings section basically adds a checkbox to allow administrators to opt-in to major core auto-updates. But it also checks for any existing constant or filter to see if the checkbox should be checked or not by default, using the following order:

  1. By default, the checkbox is unchecked.
  2. If get_site_option( 'auto_update_core_major' ) returns true, the checkbox is checked. Otherwise, it’s unchecked. This option is the one stored in the database when the checkbox value is changed.
  3. If WP_AUTO_UPDATE_CORE constant returns truebeta or rc, the checkbox is checked. If the constant returns falseminor or is not defined, the checkbox is unchecked. If this constant is set, it overrides the above parameters.
  4. If allow_major_auto_core_updates filter returns true, the checkbox is checked. If the filter returns false or is not used, the checkbox is unchecked. If this filter is used, it overrides the above parameters.

To disable the checkbox by default, developers can set the WP_AUTO_UPDATE_CORE to false (to disable all auto-updates) or minor (to enable only minor core auto-updates, which is the default behavior). It has to be done using the wp-config.php file.

Developers can alternatively use the allow_major_auto_core_updates filter to set up core major versions auto-updates to true or false by default. Example:

1
add_filter( 'allow_major_auto_core_updates', '_return_false' );

How to extend core major versions auto-updates feature?

The feature also checks for dev (development versions of WordPress) and for minor updates. There is an action hook running right before the submit button of that settings section to add some options if needed. Using the after_core_auto_updates_settings_fields action hook, developers can add other settings or texts.

For example, the following snippet adds an option to opt-in/out for minor releases auto-updates:

function my_plugin_after_core_auto_updates_settings_fields( $auto_update_settings ) {     if ( isset( $_POST['core-auto-updates-settings'] ) && wp_verify_nonce( $_POST['set_core_auto_updates_settings'], 'core-auto-updates-nonce' ) ) {         if ( isset( $_POST['my-plugin-core-auto-updates-minor'] ) && 1 === (int) $_POST['my-plugin-core-auto-updates-minor'] ) {             update_site_option( 'my_plugin_auto_update_core_minor', 1 );         } else {             update_site_option( 'my_plugin_auto_update_core_minor', 0 );         }     }     $minor_auto_updates_settings = get_site_option( 'my_plugin_auto_update_core_minor' );     ?>     <p>         <input type="checkbox" name="my-plugin-core-auto-updates-minor" id="my-plugin-core-auto-updates-minor" value="1" <?php checked( $minor_auto_updates_settings, 1 ); ?> />         <label for="my-plugin-core-auto-updates-minor">             <?php _e( 'Automatically keep this site up-to-date with minor updates.', 'my-plugin' ); ?>         </label>     </p>     <?php } add_action( 'after_core_auto_updates_settings_fields', 'my_plugin_after_core_auto_updates_settings_fields', 10, 1 );

This snippet adds a new option right after the major releases option:

WordPress 5.6


WordPress 5.6 Roadmap:


Wrapping Up

Above are the latest features of WordPress 5.6. Our team has been updating our WordPress themes to support this version. Please stay tuned!


See Our Best-selling WordPress Themes 2020:

Below are our best-selling WordPress themes 2020 compatible with WordPress 5.5.x.

BROWSE ALL WORDPRESS THEMES


See our theme collections:


Our Support Help Desks:

Documentation: Find documentation for themes and frequently asked question on our Documentation channel wpthemego.com/document

Forum Support: Join our public WPThemeGo Community at forum.wpthemego.com to find the frequently asked questions, post your problem and get support to solve it.

Ticket System: Submit a ticket about your problem on WPThemeGo Support at support.wpthemego.com to get help from the support team. All your information will be kept confidential.

Email Support: Contact us via email for presale questions about our themes and other questions via contact@wpthemego.com.

Best selling multi vendor wordpress themes

 Best Selling Multi Vendor MarketPlace WordPress Themes

You might also like

Leave Your Comment

x
Quà Tết Cao Cấp Hộp quà tết Giỏ quà tết Túi quà tết