Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#31186 new enhancement

Get more info about the modified author

Reported by: alexandruias's profile alexandruias Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Users Keywords: has-patch
Focuses: template Cc:

Description

Let's let the developers to have access to all the modified author meta not just the display name.Using the function get_the_modified_author() .

Attachments (4)

31186.patch (770 bytes) - added by alexandruias 9 years ago.
31186(1).patch (1.8 KB) - added by alexandruias 9 years ago.
Better patch
31186.2.patch (1.9 KB) - added by alexandruias 9 years ago.
fix aaray to string notice
33186.3.patch (1.8 KB) - added by alexandruias 9 years ago.
the same as the_author_meta

Download all attachments as: .zip

Change History (7)

@alexandruias
9 years ago

#1 @DrewAPicture
9 years ago

  • Component changed from General to Users
  • Keywords has-patch added

Hi @alexandruias, welcome to Trac!

This sounds like an interesting idea worth consideration. Some feedback on your patch:

  1. To avoid undefined property notices, we should probably leverage a whitelist of possible user fields when passing $last_user->$field. We'll also need to update the documentation for the the_modified_author filter to mention that the parameter could be any of 'x', 'y', or 'z' user fields
  2. Make sure to follow core coding standards for spacing in adding your parameter
  3. We'll need an @param entry added to the phpDoc for the function for the new parameter, as well as a changelog entry

For the get_the_modified_author() @param entry, something like this should work:

* @param string $field Optional. User field to retrieve for the modified author. Accepts any WP_User field. Default 'display_name'.

For the function's changelog entry, something like this should work:

* @since 4.3.0 Added the `$field` parameter.

@alexandruias
9 years ago

Better patch

#2 @alexandruias
9 years ago

@DrewAPicture Thanks for taking a look. I think we are good this time I will take care of the docs.

@alexandruias
9 years ago

fix aaray to string notice

@alexandruias
9 years ago

the same as the_author_meta

#3 @alexandruias
9 years ago

Take in consideration 31186.2.patch not the thrid

Note: See TracTickets for help on using tickets.