[wp-trac] [WordPress Trac] #40564: Show user login name in posts/pages list to avoid confusion if identical names exist

WordPress Trac noreply at wordpress.org
Mon Mar 26 17:36:36 UTC 2018


#40564: Show user login name in posts/pages list to avoid confusion if identical
names exist
---------------------------------------------+-----------------------------
 Reporter:  Presskopp                        |       Owner:
     Type:  enhancement                      |      Status:  reviewing
 Priority:  normal                           |   Milestone:  Awaiting
Component:  Posts, Post Types                |  Review
 Severity:  normal                           |     Version:  4.7.4
 Keywords:  has-patch has-screenshots close  |  Resolution:
                                             |     Focuses:  administration
---------------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch has-screenshots => has-patch has-screenshots close
 * owner:  SergeyBiryukov =>


Comment:

 I agree with @jorbin, it does seem a bit like an edge case.

 We could add a filter to `WP_Posts_List_Table::get_edit_link()`, but that
 would be inconsistent with `WP_Media_List_Table`, which doesn't have a
 corresponding method.

 That said, both `WP_Posts_List_Table` and `WP_Media_List_Table` use
 `get_the_author()` to display the author name, so adding a user login
 there is already doable via `the_author` filter:
 {{{
 function wp40564_add_user_login_to_author_name_in_admin( $display_name ) {
         global $authordata;

         if ( is_admin() && is_object( $authordata ) ) {
                 $display_name = sprintf( '%s (%s)', $display_name,
 $authordata->user_login );
         }

         return $display_name;
 }
 add_filter( 'the_author', 'wp40564_add_user_login_to_author_name_in_admin'
 );
 }}}

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


More information about the wp-trac mailing list