Make WordPress Core

Changeset 41065


Ignore:
Timestamp:
07/17/2017 08:52:26 PM (7 years ago)
Author:
flixos90
Message:

Multisite: Remove help text duplication on Edit Site screens in the network admin.

Prior to this change, the similar help tab and sidebar for these screens were all duplicated for each respective screen. This changeset introduces two internal admin functions get_site_screen_help_tab_args() and get_site_screen_help_sidebar_content() that make these available in a centralized location.

Props atanasangelovdev.
Fixes #41167.

Location:
trunk/src/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r40632 r41065  
    11411141    echo '</h2>';
    11421142}
     1143
     1144/**
     1145 * Returns the arguments for the help tab on the Edit Site screens.
     1146 *
     1147 * @since 4.9.0
     1148 *
     1149 * @return array Help tab arguments.
     1150 */
     1151function get_site_screen_help_tab_args() {
     1152    return array(
     1153        'id'      => 'overview',
     1154        'title'   => __('Overview'),
     1155        'content' =>
     1156            '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
     1157            '<p>' . __('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
     1158            '<p>' . __('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
     1159            '<p>' . sprintf( __('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
     1160            '<p>' . __('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
     1161    );
     1162}
     1163
     1164/**
     1165 * Returns the content for the help sidebar on the Edit Site screens.
     1166 *
     1167 * @since 4.9.0
     1168 *
     1169 * @return string Help sidebar content.
     1170 */
     1171function get_site_screen_help_sidebar_content() {
     1172    return '<p><strong>' . __('For more information:') . '</strong></p>' .
     1173        '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
     1174        '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>';
     1175}
  • trunk/src/wp-admin/network/site-info.php

    r39930 r41065  
    1515}
    1616
    17 get_current_screen()->add_help_tab( array(
    18     'id'      => 'overview',
    19     'title'   => __( 'Overview' ),
    20     'content' =>
    21         '<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .
    22         '<p>' . __( '<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
    23         '<p>' . __( '<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
    24         '<p>' . sprintf( __( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
    25         '<p>' . __( '<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>'
    26 ) );
    27 
    28 get_current_screen()->set_help_sidebar(
    29     '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    30     '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>' ) . '</p>' .
    31     '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
    32 );
     17get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
     18get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
    3319
    3420$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
  • trunk/src/wp-admin/network/site-settings.php

    r38824 r41065  
    1414    wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
    1515
    16 get_current_screen()->add_help_tab( array(
    17     'id'      => 'overview',
    18     'title'   => __('Overview'),
    19     'content' =>
    20         '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
    21         '<p>' . __('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
    22         '<p>' . __('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
    23         '<p>' . sprintf( __('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
    24         '<p>' . __('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
    25 ) );
    26 
    27 get_current_screen()->set_help_sidebar(
    28     '<p><strong>' . __('For more information:') . '</strong></p>' .
    29     '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
    30     '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
    31 );
     16get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
     17get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
    3218
    3319$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
  • trunk/src/wp-admin/network/site-themes.php

    r39600 r41065  
    1414    wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );
    1515
    16 get_current_screen()->add_help_tab( array(
    17     'id'      => 'overview',
    18     'title'   => __('Overview'),
    19     'content' =>
    20         '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
    21         '<p>' . __('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
    22         '<p>' . __('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
    23         '<p>' . sprintf( __('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
    24         '<p>' . __('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
    25 ) );
    26 
    27 get_current_screen()->set_help_sidebar(
    28     '<p><strong>' . __('For more information:') . '</strong></p>' .
    29     '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
    30     '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
    31 );
     16get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
     17get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
    3218
    3319get_current_screen()->set_screen_reader_content( array(
  • trunk/src/wp-admin/network/site-users.php

    r40940 r41065  
    1717$wp_list_table->prepare_items();
    1818
    19 get_current_screen()->add_help_tab( array(
    20     'id'      => 'overview',
    21     'title'   => __('Overview'),
    22     'content' =>
    23         '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
    24         '<p>' . __('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
    25         '<p>' . __('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
    26         '<p>' . sprintf( __('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
    27         '<p>' . __('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
    28 ) );
    29 
    30 get_current_screen()->set_help_sidebar(
    31     '<p><strong>' . __('For more information:') . '</strong></p>' .
    32     '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
    33     '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
    34 );
     19get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
     20get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
    3521
    3622get_current_screen()->set_screen_reader_content( array(
Note: See TracChangeset for help on using the changeset viewer.