From 092f79ab7a9318de605e187663b1dea7ee6977c2 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Tue, 16 Jun 2020 17:27:05 +0000 Subject: [PATCH] Help/About: Add help tabs to provide informations about plugin & themes auto-updates. Adds language around how the feature works and includes links to the WordPress HelpHub pages. Fixes: #50215. Props: audrasjb, garrett-eclipse, paaljoachim, marybaum, pbiron, whyisjake. git-svn-id: https://develop.svn.wordpress.org/trunk@48062 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/network/themes.php | 18 +++++++++++++++++- src/wp-admin/plugins.php | 18 +++++++++++++++++- src/wp-admin/themes.php | 21 ++++++++++++++++++++- src/wp-admin/update-core.php | 19 ++++++++++++++++++- 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/network/themes.php b/src/wp-admin/network/themes.php index c71315aa2a..2236f1ca92 100644 --- a/src/wp-admin/network/themes.php +++ b/src/wp-admin/network/themes.php @@ -302,10 +302,26 @@ get_current_screen()->add_help_tab( ) ); +$help_sidebar_autoupdates = ''; +if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) { + get_current_screen()->add_help_tab( + array( + 'id' => 'plugins-themes-auto-updates', + 'title' => __( 'Auto-updates' ), + 'content' => + '

' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '

' . + '

' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '

', + ) + ); + + $help_sidebar_autoupdates = '

' . __( 'Learn more: Auto-updates documentation' ) . '

'; +} + get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Network Themes' ) . '

' . - '

' . __( 'Support' ) . '

' + '

' . __( 'Support' ) . '

' . + $help_sidebar_autoupdates ); get_current_screen()->set_screen_reader_content( diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php index 62726ba12f..a2a771c4c3 100644 --- a/src/wp-admin/plugins.php +++ b/src/wp-admin/plugins.php @@ -565,10 +565,26 @@ get_current_screen()->add_help_tab( ) ); +$help_sidebar_autoupdates = ''; +if ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) { + get_current_screen()->add_help_tab( + array( + 'id' => 'plugins-themes-auto-updates', + 'title' => __( 'Auto-updates' ), + 'content' => + '

' . __( 'Auto-updates can be enabled or disabled for each individual plugin. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '

' . + '

' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '

', + ) + ); + + $help_sidebar_autoupdates = '

' . __( 'Learn more: Auto-updates documentation' ) . '

'; +} + get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Managing Plugins' ) . '

' . - '

' . __( 'Support' ) . '

' + '

' . __( 'Support' ) . '

' . + $help_sidebar_autoupdates ); get_current_screen()->set_screen_reader_content( diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index bb3912bd6a..5d09cfb2ad 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -182,10 +182,29 @@ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ); } // End if 'edit_theme_options' && 'customize'. +// Help tab: Auto-updates. +$help_sidebar_autoupdates = ''; +if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) { + $help_tab_autoupdates = + '

' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '

' . + '

' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '

'; + + get_current_screen()->add_help_tab( + array( + 'id' => 'plugins-themes-auto-updates', + 'title' => __( 'Auto-updates' ), + 'content' => $help_tab_autoupdates, + ) + ); + + $help_sidebar_autoupdates = '

' . __( 'Learn more: Auto-updates documentation' ) . '

'; +} // End if 'update_themes' && 'wp_is_auto_update_enabled_for_type'. + get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Using Themes' ) . '

' . - '

' . __( 'Support' ) . '

' + '

' . __( 'Support' ) . '

' . + $help_sidebar_autoupdates ); if ( current_user_can( 'switch_themes' ) ) { diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index dd9e1cd210..40c72ebe59 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -745,10 +745,27 @@ get_current_screen()->add_help_tab( ) ); +$help_sidebar_autoupdates = ''; +if ( ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) || ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) ) { + $help_tab_autoupdates = '

' . __( 'Auto-updates can be enabled or disabled for each individual theme or plugin. Themes or plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '

'; + $help_tab_autoupdates .= '

' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '

'; + + get_current_screen()->add_help_tab( + array( + 'id' => 'plugins-themes-auto-updates', + 'title' => __( 'Auto-updates' ), + 'content' => $help_tab_autoupdates, + ) + ); + + $help_sidebar_autoupdates = '

' . __( 'Learn more: Auto-updates documentation' ) . '

'; +} + get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Updating WordPress' ) . '

' . - '

' . __( 'Support' ) . '

' + '

' . __( 'Support' ) . '

' . + $help_sidebar_autoupdates ); if ( 'upgrade-core' === $action ) {