[wp-hackers] Change the user avatar url to a user meta field url?

Janneke Van Dorpe jannekevandorpe at gmail.com
Wed Jan 15 11:50:17 UTC 2014


Agreed, you could overwrite it both ways. Filters are preferable.

On 15 Jan 2014, at 11:33, Nikola Nikolov wrote:

> I personally would go with the filters. Simply because there might be a
> third plugin that says - "hey this user should have a special avatar(the
> user added a "badge" to their photo for instance), I'll add my filter last
> and I'll return my output".
> 
> After all that's the whole purpose of filters and actions in WordPress :)
> 
> 
> On Wed, Jan 15, 2014 at 1:20 PM, Janneke Van Dorpe <
> jannekevandorpe at gmail.com> wrote:
> 
>> You could also completely overwrite get_avatar() and point it to a meta
>> field with a URL or ID to an attachment.
>> 
>> http://codex.wordpress.org/Function_Reference/get_avatar
>> 
>> On 15 Jan 2014, at 10:17, Nikola Nikolov wrote:
>> 
>>> You can still use a plugin for that. For instance this plugin -
>>> http://wordpress.org/plugins/user-avatar/ . It's very simple since all
>> it
>>> does is add interface in the edit profile page in the admin that allows
>> you
>>> to upload a photo to the media library(I think) and then use that as your
>>> avatar. It also allows you to crop the photo. What I'd advice you to do
>> is
>>> to simply download the plugin and go through it's source - it's basically
>>> three .php files, one of which is timthumb(yeah, I know - that's not good
>>> in a plugin :) ).
>>> 
>>> 
>>> On Wed, Jan 15, 2014 at 12:03 PM, BenderisGreat
>>> <greglancaster71 at gmail.com>wrote:
>>> 
>>>> I know there are plugins for handling a local user avatar, but it seems
>>>> like
>>>> a giant pain in the ass to code something myself for this.  I even asked
>>>> around and was told to just use a plugin, but I cannot package someone
>>>> elses
>>>> plugin with what I am making.
>>>> 
>>>> So, I am wondering if there is a way to replace the user avatar with a
>> user
>>>> meta field that points to a url.  I know it wont technically be an
>> avatar
>>>> in
>>>> wordpress' eyes, but this would be much simple to allow front end avatar
>>>> uploading.  Just select an image, store the url in a custom field, and
>> then
>>>> have the avatar call redirected to look at the users avatar meta field.
>>>> 
>>>> Is this a realistic solution?
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>>> 
>> http://wordpress-hackers.1065353.n5.nabble.com/Change-the-user-avatar-url-to-a-user-meta-field-url-tp43195.html
>>>> Sent from the Wordpress Hackers mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> wp-hackers mailing list
>>>> wp-hackers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>> 
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list