[wp-trac] [WordPress Trac] #31186: Get more info about the modified author
WordPress Trac
noreply at wordpress.org
Fri Apr 24 20:13:43 UTC 2015
#31186: Get more info about the modified author
--------------------------+------------------------------
Reporter: alexandruias | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version: 4.2
Severity: normal | Resolution:
Keywords: has-patch | Focuses: template
--------------------------+------------------------------
Changes (by DrewAPicture):
* keywords: => has-patch
* component: General => Users
Comment:
Hi @alexandruias, welcome to Trac!
This sounds like an interesting idea worth consideration. Some feedback on
your [attachment:31186.patch 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
1. Make sure to follow [https://make.wordpress.org/core/handbook/coding-
standards/php/#space-usage core coding standards] for spacing in adding
your parameter
1. 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.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31186#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list