Make WordPress Core

Changeset 51475


Ignore:
Timestamp:
07/22/2021 01:51:58 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Add a comment about the $title global usage in various admin files.

This should make it clear that the variable is used as part of the HTML <title> tag on admin screens.

Props ravipatel, hellofromTonya, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #53729.

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

Legend:

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

    r49558 r51475  
    3030}
    3131
     32// Used in the HTML title tag.
    3233$title       = __( 'Dashboard' );
    3334$parent_file = 'index.php';
  • trunk/src/wp-admin/about.php

    r51473 r51475  
    1010require_once __DIR__ . '/admin.php';
    1111
     12// Used in the HTML title tag.
    1213/* translators: Page title of the About WordPress page in the admin. */
    1314$title = _x( 'About', 'page title' );
  • trunk/src/wp-admin/admin.php

    r51327 r51475  
    335335    do_action( "load-importer-{$importer}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    336336
     337    // Used in the HTML title tag.
     338    $title        = __( 'Import' );
    337339    $parent_file  = 'tools.php';
    338340    $submenu_file = 'import.php';
    339     $title        = __( 'Import' );
    340341
    341342    if ( ! isset( $_GET['noheader'] ) ) {
  • trunk/src/wp-admin/authorize-application.php

    r51463 r51475  
    6363}
    6464
     65// Used in the HTML title tag.
    6566$title = __( 'Authorize Application' );
    6667
  • trunk/src/wp-admin/comment.php

    r51178 r51475  
    5454
    5555    case 'editcomment':
     56        // Used in the HTML title tag.
    5657        $title = __( 'Edit Comment' );
    5758
     
    9798    case 'trash':
    9899    case 'spam':
     100        // Used in the HTML title tag.
    99101        $title = __( 'Moderate Comment' );
    100102
  • trunk/src/wp-admin/credits.php

    r51413 r51475  
    1111require_once __DIR__ . '/includes/credits.php';
    1212
     13// Used in the HTML title tag.
    1314$title = __( 'Credits' );
    1415
  • trunk/src/wp-admin/edit-comments.php

    r50999 r51475  
    139139    $comments_count      = wp_count_comments( $post_id );
    140140    $draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' );
     141
    141142    if ( $comments_count->moderated > 0 ) {
     143        // Used in the HTML title tag.
    142144        $title = sprintf(
    143145            /* translators: 1: Comments count, 2: Post title. */
     
    147149        );
    148150    } else {
     151        // Used in the HTML title tag.
    149152        $title = sprintf(
    150153            /* translators: %s: Post title. */
     
    155158} else {
    156159    $comments_count = wp_count_comments();
     160
    157161    if ( $comments_count->moderated > 0 ) {
     162        // Used in the HTML title tag.
    158163        $title = sprintf(
    159164            /* translators: %s: Comments count. */
     
    162167        );
    163168    } else {
     169        // Used in the HTML title tag.
    164170        $title = __( 'Comments' );
    165171    }
  • trunk/src/wp-admin/edit.php

    r51163 r51475  
    233233}
    234234
     235// Used in the HTML title tag.
    235236$title = $post_type_object->labels->name;
    236237
  • trunk/src/wp-admin/export.php

    r50001 r51475  
    1616/** Load WordPress export API */
    1717require_once ABSPATH . 'wp-admin/includes/export.php';
     18
     19// Used in the HTML title tag.
    1820$title = __( 'Export' );
    1921
  • trunk/src/wp-admin/freedoms.php

    r51356 r51475  
    1616}
    1717
     18// Used in the HTML title tag.
    1819$title = __( 'Freedoms' );
    1920
  • trunk/src/wp-admin/import.php

    r48520 r51475  
    1616}
    1717
     18// Used in the HTML title tag.
    1819$title = __( 'Import' );
    1920
  • trunk/src/wp-admin/link-add.php

    r47198 r51475  
    1414}
    1515
     16// Used in the HTML title tag.
    1617$title       = __( 'Add New Link' );
    1718$parent_file = 'link-manager.php';
  • trunk/src/wp-admin/link-manager.php

    r49286 r51475  
    4747$wp_list_table->prepare_items();
    4848
     49// Used in the HTML title tag.
    4950$title       = __( 'Links' );
    5051$this_file   = 'link-manager.php';
  • trunk/src/wp-admin/link.php

    r49193 r51475  
    109109        $parent_file  = 'link-manager.php';
    110110        $submenu_file = 'link-manager.php';
     111        // Used in the HTML title tag.
    111112        $title        = __( 'Edit Link' );
    112113
  • trunk/src/wp-admin/media-new.php

    r51177 r51475  
    4040}
    4141
     42// Used in the HTML title tag.
    4243$title       = __( 'Upload New Media' );
    4344$parent_file = 'upload.php';
  • trunk/src/wp-admin/media.php

    r47855 r51475  
    4646        // No break.
    4747    case 'edit':
     48        // Used in the HTML title tag.
    4849        $title = __( 'Edit Media' );
    4950
  • trunk/src/wp-admin/ms-delete-site.php

    r49078 r51475  
    3636$user = wp_get_current_user();
    3737
     38// Used in the HTML title tag.
    3839$title       = __( 'Delete Site' );
    3940$parent_file = 'tools.php';
     41
    4042require_once ABSPATH . 'wp-admin/admin-header.php';
    4143
  • trunk/src/wp-admin/my-sites.php

    r50981 r51475  
    3535}
    3636
     37// Used in the HTML title tag.
    3738$title       = __( 'My Sites' );
    3839$parent_file = 'index.php';
  • trunk/src/wp-admin/network.php

    r47848 r51475  
    5050
    5151if ( is_network_admin() ) {
     52    // Used in the HTML title tag.
    5253    $title       = __( 'Network Setup' );
    5354    $parent_file = 'settings.php';
    5455} else {
     56    // Used in the HTML title tag.
    5557    $title       = __( 'Create a Network of WordPress Sites' );
    5658    $parent_file = 'tools.php';
  • trunk/src/wp-admin/network/index.php

    r47198 r51475  
    1818}
    1919
     20// Used in the HTML title tag.
    2021$title       = __( 'Dashboard' );
    2122$parent_file = 'index.php';
  • trunk/src/wp-admin/network/settings.php

    r50772 r51475  
    1818}
    1919
     20// Used in the HTML title tag.
    2021$title       = __( 'Network Settings' );
    2122$parent_file = 'settings.php';
  • trunk/src/wp-admin/network/site-info.php

    r49962 r51475  
    123123}
    124124
     125// Used in the HTML title tag.
    125126/* translators: %s: Site title. */
    126127$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
  • trunk/src/wp-admin/network/site-new.php

    r51189 r51475  
    175175}
    176176
     177// Used in the HTML title tag.
    177178$title       = __( 'Add New Site' );
    178179$parent_file = 'sites.php';
  • trunk/src/wp-admin/network/site-settings.php

    r49108 r51475  
    8080}
    8181
     82// Used in the HTML title tag.
    8283/* translators: %s: Site title. */
    8384$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
  • trunk/src/wp-admin/network/site-themes.php

    r49108 r51475  
    167167add_screen_option( 'per_page' );
    168168
     169// Used in the HTML title tag.
    169170/* translators: %s: Site title. */
    170171$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
  • trunk/src/wp-admin/network/site-users.php

    r51189 r51475  
    196196add_screen_option( 'per_page' );
    197197
     198// Used in the HTML title tag.
    198199/* translators: %s: Site title. */
    199200$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
  • trunk/src/wp-admin/network/sites.php

    r51189 r51475  
    1818$pagenum       = $wp_list_table->get_pagenum();
    1919
     20// Used in the HTML title tag.
    2021$title       = __( 'Sites' );
    2122$parent_file = 'sites.php';
  • trunk/src/wp-admin/network/themes.php

    r49286 r51475  
    8282            }
    8383
     84            // Used in the HTML title tag.
    8485            $title       = __( 'Update Themes' );
    8586            $parent_file = 'themes.php';
     
    334335);
    335336
     337// Used in the HTML title tag.
    336338$title       = __( 'Themes' );
    337339$parent_file = 'themes.php';
  • trunk/src/wp-admin/network/upgrade.php

    r49108 r51475  
    1313require_once ABSPATH . WPINC . '/http.php';
    1414
     15// Used in the HTML title tag.
    1516$title       = __( 'Upgrade Network' );
    1617$parent_file = 'upgrade.php';
  • trunk/src/wp-admin/network/user-new.php

    r51189 r51475  
    9999}
    100100
     101// Used in the HTML title tag.
    101102$title       = __( 'Add New User' );
    102103$parent_file = 'users.php';
  • trunk/src/wp-admin/network/users.php

    r51189 r51475  
    3030            if ( $id > 1 ) {
    3131                $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays.
     32
     33                // Used in the HTML title tag.
    3234                $title             = __( 'Users' );
    3335                $parent_file       = 'users.php';
     36
    3437                require_once ABSPATH . 'wp-admin/admin-header.php';
     38
    3539                echo '<div class="wrap">';
    3640                confirm_delete_users( $_POST['allusers'] );
    3741                echo '</div>';
     42
    3843                require_once ABSPATH . 'wp-admin/admin-footer.php';
    3944            } else {
     
    6065                                    wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
    6166                                }
     67
     68                                // Used in the HTML title tag.
    6269                                $title       = __( 'Users' );
    6370                                $parent_file = 'users.php';
     71
    6472                                require_once ABSPATH . 'wp-admin/admin-header.php';
     73
    6574                                echo '<div class="wrap">';
    6675                                confirm_delete_users( $_POST['allusers'] );
    6776                                echo '</div>';
     77
    6878                                require_once ABSPATH . 'wp-admin/admin-footer.php';
    6979                                exit;
     
    207217    exit;
    208218}
     219
     220// Used in the HTML title tag.
    209221$title       = __( 'Users' );
    210222$parent_file = 'users.php';
  • trunk/src/wp-admin/options-discussion.php

    r48575 r51475  
    1313}
    1414
     15// Used in the HTML title tag.
    1516$title       = __( 'Discussion Settings' );
    1617$parent_file = 'options-general.php';
  • trunk/src/wp-admin/options-general.php

    r48991 r51475  
    1717}
    1818
     19// Used in the HTML title tag.
    1920$title       = __( 'General Settings' );
    2021$parent_file = 'options-general.php';
  • trunk/src/wp-admin/options-media.php

    r51075 r51475  
    1414}
    1515
     16// Used in the HTML title tag.
    1617$title       = __( 'Media Settings' );
    1718$parent_file = 'options-general.php';
  • trunk/src/wp-admin/options-permalink.php

    r50830 r51475  
    1414}
    1515
     16// Used in the HTML title tag.
    1617$title       = __( 'Permalink Settings' );
    1718$parent_file = 'options-general.php';
  • trunk/src/wp-admin/options-reading.php

    r50702 r51475  
    1414}
    1515
     16// Used in the HTML title tag.
    1617$title       = __( 'Reading Settings' );
    1718$parent_file = 'options-general.php';
  • trunk/src/wp-admin/options-writing.php

    r49912 r51475  
    1414}
    1515
     16// Used in the HTML title tag.
    1617$title       = __( 'Writing Settings' );
    1718$parent_file = 'options-general.php';
  • trunk/src/wp-admin/options.php

    r50560 r51475  
    1919require_once __DIR__ . '/admin.php';
    2020
     21// Used in the HTML title tag.
    2122$title       = __( 'Settings' );
    2223$this_file   = 'options.php';
  • trunk/src/wp-admin/plugin-editor.php

    r50032 r51475  
    1919}
    2020
     21// Used in the HTML title tag.
    2122$title       = __( 'Edit Plugins' );
    2223$parent_file = 'plugins.php';
  • trunk/src/wp-admin/plugin-install.php

    r48281 r51475  
    4848}
    4949
     50// Used in the HTML title tag.
    5051$title       = __( 'Add Plugins' );
    5152$parent_file = 'plugins.php';
  • trunk/src/wp-admin/plugins.php

    r49683 r51475  
    154154            }
    155155
     156            // Used in the HTML title tag.
    156157            $title       = __( 'Update Plugins' );
    157158            $parent_file = 'plugins.php';
     
    598599);
    599600
     601// Used in the HTML title tag.
    600602$title       = __( 'Plugins' );
    601603$parent_file = 'plugins.php';
  • trunk/src/wp-admin/privacy.php

    r51356 r51475  
    1010require_once __DIR__ . '/admin.php';
    1111
     12// Used in the HTML title tag.
    1213$title = __( 'Privacy' );
    1314
  • trunk/src/wp-admin/revision.php

    r49539 r51475  
    109109        $h1             = sprintf( __( 'Compare Revisions of &#8220;%s&#8221;' ), $post_title );
    110110        $return_to_post = '<a href="' . $post_edit_link . '">' . __( '&larr; Go to editor' ) . '</a>';
     111        // Used in the HTML title tag.
    111112        $title          = __( 'Revisions' );
    112113
  • trunk/src/wp-admin/theme-editor.php

    r50032 r51475  
    1919}
    2020
     21// Used in the HTML title tag.
    2122$title       = __( 'Edit Themes' );
    2223$parent_file = 'themes.php';
  • trunk/src/wp-admin/theme-install.php

    r50813 r51475  
    2222}
    2323
     24// Used in the HTML title tag.
    2425$title       = __( 'Add Themes' );
    2526$parent_file = 'themes.php';
  • trunk/src/wp-admin/themes.php

    r51177 r51475  
    124124}
    125125
     126// Used in the HTML title tag.
    126127$title       = __( 'Manage Themes' );
    127128$parent_file = 'themes.php';
  • trunk/src/wp-admin/tools.php

    r50161 r51475  
    4040require_once __DIR__ . '/admin.php';
    4141
     42// Used in the HTML title tag.
    4243$title = __( 'Tools' );
    4344
  • trunk/src/wp-admin/update-core.php

    r51185 r51475  
    11371137    $url = wp_nonce_url( $url, 'bulk-update-plugins' );
    11381138
     1139    // Used in the HTML title tag.
    11391140    $title = __( 'Update Plugins' );
    11401141
     
    11771178    $url = wp_nonce_url( $url, 'bulk-update-themes' );
    11781179
     1180    // Used in the HTML title tag.
    11791181    $title = __( 'Update Themes' );
    11801182
  • trunk/src/wp-admin/update.php

    r48417 r51475  
    6060        check_admin_referer( 'upgrade-plugin_' . $plugin );
    6161
     62        // Used in the HTML title tag.
    6263        $title        = __( 'Update Plugin' );
    6364        $parent_file  = 'plugins.php';
     
    124125        }
    125126
     127        // Used in the HTML title tag.
    126128        $title        = __( 'Plugin Installation' );
    127129        $parent_file  = 'plugins.php';
    128130        $submenu_file = 'plugin-install.php';
     131
    129132        require_once ABSPATH . 'wp-admin/admin-header.php';
    130133
     
    154157        $file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
    155158
     159        // Used in the HTML title tag.
    156160        $title        = __( 'Upload Plugin' );
    157161        $parent_file  = 'plugins.php';
    158162        $submenu_file = 'plugin-install.php';
     163
    159164        require_once ABSPATH . 'wp-admin/admin-header.php';
    160165
     
    207212        wp_enqueue_script( 'updates' );
    208213
     214        // Used in the HTML title tag.
    209215        $title        = __( 'Update Theme' );
    210216        $parent_file  = 'themes.php';
    211217        $submenu_file = 'themes.php';
     218
    212219        require_once ABSPATH . 'wp-admin/admin-header.php';
    213220
     
    270277        }
    271278
     279        // Used in the HTML title tag.
    272280        $title        = __( 'Install Themes' );
    273281        $parent_file  = 'themes.php';
    274282        $submenu_file = 'themes.php';
     283
    275284        require_once ABSPATH . 'wp-admin/admin-header.php';
    276285
     
    296305        $file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
    297306
     307        // Used in the HTML title tag.
    298308        $title        = __( 'Upload Theme' );
    299309        $parent_file  = 'themes.php';
  • trunk/src/wp-admin/upload.php

    r51189 r51475  
    7777    );
    7878
     79    // Used in the HTML title tag.
    7980    $title       = __( 'Media Library' );
    8081    $parent_file = 'upload.php';
     
    216217$wp_list_table->prepare_items();
    217218
     219// Used in the HTML title tag.
    218220$title       = __( 'Media Library' );
    219221$parent_file = 'upload.php';
  • trunk/src/wp-admin/user-edit.php

    r51330 r51475  
    3333
    3434if ( IS_PROFILE_PAGE ) {
     35    // Used in the HTML title tag.
    3536    $title = __( 'Profile' );
    3637} else {
     38    // Used in the HTML title tag.
    3739    /* translators: %s: User's display name. */
    3840    $title = __( 'Edit User %s' );
  • trunk/src/wp-admin/user-new.php

    r49298 r51475  
    246246}
    247247
     248// Used in the HTML title tag.
    248249$title       = __( 'Add New User' );
    249250$parent_file = 'users.php';
  • trunk/src/wp-admin/users.php

    r51177 r51475  
    2121$wp_list_table = _get_list_table( 'WP_Users_List_Table' );
    2222$pagenum       = $wp_list_table->get_pagenum();
    23 $title         = __( 'Users' );
    24 $parent_file   = 'users.php';
     23
     24// Used in the HTML title tag.
     25$title       = __( 'Users' );
     26$parent_file = 'users.php';
    2527
    2628add_screen_option( 'per_page' );
  • trunk/src/wp-admin/widgets.php

    r51061 r51475  
    2525}
    2626
     27// Used in the HTML title tag.
    2728$title       = __( 'Widgets' );
    2829$parent_file = 'themes.php';
Note: See TracChangeset for help on using the changeset viewer.