[wp-trac] [WordPress Trac] #21930: Allow hooks to define avatar before Gravatar processing
WordPress Trac
wp-trac at lists.automattic.com
Wed Sep 19 16:30:36 UTC 2012
#21930: Allow hooks to define avatar before Gravatar processing
-----------------------------+-------------------------
Reporter: jakemgold | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: trunk | Severity: trivial
Keywords: has-patch |
-----------------------------+-------------------------
The get_avatar() function allows for developers to override avatar output
in two ways. You can replace the function (pluggable) - not a good idea in
my view, especially if you still want the ability to fallback and use
Gravatar sometimes. You can also filter the output at the very end of the
function with the 'get_avatar' hook. This works fine, but in highly common
instances where a plug-in might want to override the avatar on a case by
case basis, this forces each get_avatar call to needlessly process through
the entire default avatar / Gravatar "construction".
Admittedly, that processing is mostly trivial string manipulation and
conditionals with an md5 in the mix, but it still seems like needless
overhead in instances where many avatars might get called in a comments
thread or authors list.
Proposing a pretty trivial change that allows an avatar to be defined by a
filter hook before proceeding through Gravatar / default avatar
processing, skipping over all of that if one is, in fact, defined.
My inspiration for this is an attempt to improve the performance of my
fairly popular Simple Local Avatars plug-in, that allows users to upload
local avatars: http://wordpress.org/extend/plugins/simple-local-avatars/
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21930>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list