Make WordPress Core

Ticket #50215: 50215.diff

File 50215.diff, 6.4 KB (added by audrasjb, 5 years ago)

Upgrade/Install: Add help tabs related to auto-updates UI

  • src/wp-admin/network/themes.php

    diff --git a/src/wp-admin/network/themes.php b/src/wp-admin/network/themes.php
    index c71315aa2a..5dde2f10ee 100644
    a b get_current_screen()->add_help_tab( 
    302302        )
    303303);
    304304
     305$help_sidebar_autoupdates = '';
     306if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) {
     307        get_current_screen()->add_help_tab(
     308                array(
     309                        'id'      => 'auto-updates',
     310                        'title'   => __( 'Auto-updates' ),
     311                        'content' =>
     312                                '<p>' . __( 'Auto-updates can be enabled and disabled on a theme by theme basis. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>' .
     313                                '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>',
     314                )
     315        );
     316
     317        $help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/support/article/auto-updates/">Documentation on Managing Auto-updates</a>' ) . '</p>';
     318}
     319
    305320get_current_screen()->set_help_sidebar(
    306321        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    307322        '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Themes_Screen">Documentation on Network Themes</a>' ) . '</p>' .
    308         '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
     323        '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' .
     324        $help_sidebar_autoupdates
    309325);
    310326
    311327get_current_screen()->set_screen_reader_content(
  • src/wp-admin/plugins.php

    diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php
    index 62726ba12f..6bd3db31cc 100644
    a b get_current_screen()->add_help_tab( 
    565565        )
    566566);
    567567
     568$help_sidebar_autoupdates = '';
     569if ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) {
     570        get_current_screen()->add_help_tab(
     571                array(
     572                        'id'      => 'auto-updates',
     573                        'title'   => __( 'Auto-updates' ),
     574                        'content' =>
     575                                        '<p>' . __( 'Auto-updates can be enabled and disabled on a plugin by plugin basis. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>' .
     576                                        '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>',
     577                )
     578        );
     579
     580        $help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/support/article/auto-updates/">Documentation on Managing Auto-updates</a>' ) . '</p>';
     581}
     582
    568583get_current_screen()->set_help_sidebar(
    569584        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    570585        '<p>' . __( '<a href="https://wordpress.org/support/article/managing-plugins/">Documentation on Managing Plugins</a>' ) . '</p>' .
    571         '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
     586        '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' .
     587        $help_sidebar_autoupdates
    572588);
    573589
    574590get_current_screen()->set_screen_reader_content(
  • src/wp-admin/themes.php

    diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php
    index 6ee6b14462..bc9716cd3e 100644
    a b if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) 
    182182        );
    183183} // End if 'edit_theme_options' && 'customize'.
    184184
     185// Help tab: Auto-updates.
     186$help_sidebar_autoupdates = '';
     187if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) {
     188        $help_tab_autoupdates =
     189                '<p>' . __( 'Auto-updates can be enabled and disabled on a theme by theme basis. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>' .
     190                '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>';
     191
     192        get_current_screen()->add_help_tab(
     193                array(
     194                        'id'      => 'auto-updates',
     195                        'title'   => __( 'Auto-updates' ),
     196                        'content' => $help_tab_autoupdates,
     197                )
     198        );
     199
     200        $help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/support/article/auto-updates/">Documentation on Managing Auto-updates</a>' ) . '</p>';
     201} // End if 'update_themes' && 'wp_is_auto_update_enabled_for_type'.
     202
    185203get_current_screen()->set_help_sidebar(
    186204        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    187205        '<p>' . __( '<a href="https://wordpress.org/support/article/using-themes/">Documentation on Using Themes</a>' ) . '</p>' .
    188         '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
     206        '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' .
     207        $help_sidebar_autoupdates
    189208);
    190209
    191210if ( current_user_can( 'switch_themes' ) ) {
  • src/wp-admin/update-core.php

    diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php
    index aa2f91c37d..a792d7758c 100644
    a b get_current_screen()->add_help_tab( 
    745745        )
    746746);
    747747
     748$help_sidebar_autoupdates = '';
     749if ( ( 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' ) ) ) {
     750        $help_tab_autoupdates  = '<p>' . __( 'Auto-updates can be enabled and disabled on a theme by theme basis. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>';
     751        $help_tab_autoupdates .= '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>';
     752
     753        get_current_screen()->add_help_tab(
     754                array(
     755                        'id'      => 'auto-updates',
     756                        'title'   => __( 'Auto-updates' ),
     757                        'content' => $help_tab_autoupdates,
     758                )
     759        );
     760
     761        $help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/support/article/auto-updates/">Documentation on Managing Auto-updates</a>' ) . '</p>';
     762}
     763
    748764get_current_screen()->set_help_sidebar(
    749765        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    750766        '<p>' . __( '<a href="https://wordpress.org/support/article/dashboard-updates-screen/">Documentation on Updating WordPress</a>' ) . '</p>' .
    751         '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
     767        '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' .
     768        $help_sidebar_autoupdates
    752769);
    753770
    754771if ( 'upgrade-core' === $action ) {