Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a user who uploaded a custom avatar, I do not want to get fooled about using Gravatar #54

Open
franz-josef-kaiser opened this issue Nov 16, 2016 · 6 comments
Assignees
Projects
Milestone

Comments

@franz-josef-kaiser
Copy link
Member

franz-josef-kaiser commented Nov 16, 2016

With WP 4.4, a description below a users avatar on its profile page was introduced. It is advertising for Gravatar and of no use if the user already uploaded a custom avatar. As we already properly display a custom avatar there, we should change this.

bildschirmfoto 2016-11-16 um 20 36 01

It only shows when IS_PROFILE_PAGE is set and true. The user_profile_picture_description-filter allows changing this string. We should do that:

add_filter( 'user_profile_picture_description', function( $descr ) {

    if ( 
        defined( 'IS_PROFILE_PAGE' ) and IS_PROFILE_PAGE
        && apply_filters( 'wcm.avatar.enable_custom_avatar', TRUE )
    ) {
        $has = get_user_meta( 
            get_current_user_id(), 
            apply_filters( 'wcm.avatar.meta_key', 'user_avatar' ),
            TRUE 
        );
        $descr = $has
            ? 'You can change your avatar by defining a new one <a href="#tmpl-main--container">here</a>.'
            : 'You can upload an avatar <a href="#tmpl-main--container">on top</a>.';
    }

    return $descr;
} );

/Cc @stephenharris Maybe you got some input on how to phrase the description?

@kraftner
Copy link
Member

Just some thoughts:

Do we really need the IS_PROFILE_PAGE check? It looks like this filter isn't used anywhere else anyway.

Concerning the wording I'd make it consistent.

'You can change your avatar by uploading a new one <a href="#tmpl-main--container">here</a>.'
'You can upload an avatar <a href="#tmpl-main--container">here</a>.';

Also I think we should avoid mentioning any location considering #31

@franz-josef-kaiser
Copy link
Member Author

@kraftner Yes, the check is needed to use the correct function to retrieve the ID of the right user – something that is missing in above example.

@franz-josef-kaiser
Copy link
Member Author

About the localisation: Did you link the wrong ticket?

@kraftner
Copy link
Member

Ahh, now I get it. Thanks for the clarification.

About the localisation: Did you link the wrong ticket?

No I didn't and I said location, not localisation. 😄
If we make the positioning of the UI flexible as proposed in #31 using the word "top" could be wrong, so better avoid any wording like that.

@franz-josef-kaiser
Copy link
Member Author

Ah, got it! :D

@kraftner
Copy link
Member

I think this issue would be ready for a PR, @franz-josef-kaiser ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.0.0
Backlog
Development

No branches or pull requests

2 participants