[wp-trac] [WordPress Trac] #41544: $id_or_email parameter in get_avatar filter needs to be more concrete
WordPress Trac
noreply at wordpress.org
Thu Aug 3 19:56:52 UTC 2017
#41544: $id_or_email parameter in get_avatar filter needs to be more concrete
----------------------------+------------------------------
Reporter: dikiy_forester | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
----------------------------+------------------------------
Comment (by SergeyBiryukov):
Replying to [comment:2 dikiy_forester]:
> At least this block of code might be extracted from the
{{{get_avatar_data()}}} to a separate function.
Sounds good.
> As of original ticket topic, I still think that parameter
{{{$id_or_email}}} needs to be concretized and contain the user id if
available OR gravatar hash otherwise. So, developer can determine if it's
a numeric value - it's user ID, otherwise it's a hash.
Changing the type of an existing parameter is not really possible due to
backwards compatibility concerns, especially for a pluggable function like
`get_avatar()`, which could entirely be replaced with a custom
implementation, but needs to maintain a compatible function signature.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41544#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list