[wp-trac] [WordPress Trac] #53729: Add readability comment to $title variable used in admin-header (was: $title never used, Replaced with text)

WordPress Trac noreply at wordpress.org
Wed Jul 21 23:25:06 UTC 2021


#53729: Add readability comment to $title variable used in admin-header
-------------------------+-------------------------------
 Reporter:  ravipatel    |       Owner:  hellofromTonya
     Type:  enhancement  |      Status:  accepted
 Priority:  normal       |   Milestone:  5.9
Component:  Help/About   |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  coding-standards
-------------------------+-------------------------------
Changes (by hellofromTonya):

 * owner:  (none) => hellofromTonya
 * status:  new => accepted
 * milestone:  Awaiting Review => 5.9


Old description:

> [[Image(https://prnt.sc/1e3ulze)]]
>
> We have fixed in patch please review. Code re-usability.

New description:

 Add a readability comment above each instance of `$title = __( '' )` in
 each admin panel's file. This `$title` is used to populate the `<title>`
 element which is built in the reusable `wp-admin/admin-header.php` file.

 The comment will avoid confusion on panel file's where the translated
 content reads the same for the `<title>` and `<h1>`. For example, the
 confusion can occur in the `wp-admin/privacy.php`:

 {{{#!php
 $title = __( 'Privacy' );
 ...
 require_once ABSPATH . 'wp-admin/admin-header.php';
 ...
 <div class="about__header-title">
         <h1>
                 <?php _e( 'Privacy' ); ?>
         </h1>
 </div>
 }}}

--

Comment:

 w00t!

 Replying to [comment:5 ravipatel]:
 > @hellofromTonya yes i will do patch for this.

 Updated the ticket's title and description to match the new scope of this
 ticket (helps in discoverability).

 Also moving into the 5.9 milestone.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53729#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list