I’ve seen plugins and snippets on how to set a new default avatar for a site. I’m wondering if this can be done network-wide, such that every new site on the network will have the network’s avatar as its primary default. from there the plugin’s that allow the user to upload a new avatar will be sufficient to let each site define it’s own. But until they do I’d prefer they have my avatar than the mystery man or some of the others which are downright ugly.
Leave a Reply
You must be logged in to post a comment.
The avatar_default is the better option.
Simple. Stick that in a mu-plugin and you’re good to go.
Edit: If you want to still allow site owners to change the default avatar, use the
default_option_avatar_default
hook instead.Must Use Plugins will anable functionality global. And actualy functionality is pretty simple… only prefiltring default_avatar value.
Use this code as plugin which you can install to anable default avatar.
Update New code
Using get_avatar filter hook you can replace the original avatar
Using a… get_avatar function. get avatar is plugable function, which mean you can ovveride it in any plugin, theme or in our case in mu-plugin
In my mu-plugins folder I now have the following code, which adds a custom avatar as the default network wide, but allows each individual site to change it thereafter.
EDIT #1
Per @Otto’s comment about the
default_option_avatar_default_filter
I’ve changed the new blogupdate_option
action to use the default filter instead.