WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#32286 closed defect (bug) (fixed)

How do I change my profile picture?

Reported by: iseulde Owned by: SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Users Keywords: good-first-bug has-screenshots has-patch commit
Focuses: administration Cc:

Description

Nowhere does it mention the profile picture under "Your Profile", not even under the help tab of the page. There's a link "Documentation on User Profiles" to the codex, but nothing there either. People are left with the support forum and search engines to try.

Attachments (6)

32286-helptab.diff (1.6 KB) - added by carolinegeven 4 years ago.
32286-form.diff (758 bytes) - added by carolinegeven 4 years ago.
32286.patch (836 bytes) - added by SergeyBiryukov 4 years ago.
32286.after.png (34.0 KB) - added by SergeyBiryukov 4 years ago.
32286-add-filters-all-profiles.diff (1.5 KB) - added by obrienlabs 4 years ago.
Adds a filter on the description and moves the IS_PROFILE_PAGE down to only display the description on IS_PROFILE_PAGE, but always show the avatar on other user edit pages
32286.2.patch (1.1 KB) - added by SergeyBiryukov 4 years ago.

Download all attachments as: .zip

Change History (23)

This ticket was mentioned in Slack in #core by johnbillion. View the logs.


4 years ago

#2 @johnbillion
4 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release

#3 @carolinegeven
4 years ago

  • Keywords has-patch added; needs-patch removed

I've worked on this on the contributor day of WordCamp Netherlands.

I've created two patches with two possible solutions to this issue. I'd love to get some feedback about the solutions. I've attached screenshots to show the different approaches.

32286-helptab.diff - added an explanation to the help tab.
https://cldup.com/YVg_Ls--ed.png

32286-form.diff - added a Gravatar preview and an explanation to the profile fields. https://cldup.com/NuBc8DQcKL.png

#4 follow-up: @iCaleb
4 years ago

I like this a lot. I've been asked quite a few times how to set a profile picture, and we definitely cannot assume that a user will just *know* that they should go to gravatar.com.

I'm in favor of the second patch, 32286-form.diff. However, what would be the harm in displaying this for all users on the site? I don't think a IS_PROFILE_PAGE check may be necessary.

And then I'm not good at translation functions, but I think the sprintf and printf could be merged perhaps?

Last edited 4 years ago by iCaleb (previous) (diff)

#5 in reply to: ↑ 4 @carolinegeven
4 years ago

Replying to iCaleb:

I like this a lot. I've been asked quite a few times how to set a profile picture, and we definitely cannot assume that a user will just *know* that they should go to gravatar.com.

I'm in favor of the second patch, 32286-form.diff. However, what would be the harm in displaying this for all users on the site? I don't think a IS_PROFILE_PAGE check may be necessary.

And then I'm not good at translation functions, but I think the sprintf and printf could be merged perhaps?

Thanks! I appreciate the feedback!

The check isn't necessary, you're right about that. The reason I decided on the IS_PROFILE_PAGE check, is because only the user him/herself can change their profile pic on Gravatar. As a super admin, I wouldn't be able to change the profile picture for someone else. If people prefer to always display that, then I'm all for that too.

The reason I seperared the printf and sprintf, is for readability. That can be merged should that be the preferred way!

#6 @sdavis2702
4 years ago

I like this a lot. I'd rather see it in the "About Yourself" section, though... perhaps below the Biographical Info section. It may also be worth noting that the email address field is used to pull the Gravatar image as a reminder for those who already have it set up but maybe decided to use a different email address for the site. Thoughts?

#7 @SergeyBiryukov
4 years ago

  • Milestone changed from Future Release to 4.4

32286.patch moves the preview to the About Yourself section: 32286.after.png.

#8 @DrewAPicture
4 years ago

  • Keywords has-screenshots added

#9 @DrewAPicture
4 years ago

  • Focuses administration added

#10 @iseulde
4 years ago

Glad to see some interest here! Should there be a filter on the link to Gravatar? Or something so that plugins can change the text?

#11 @mrahmadawais
4 years ago

@iseulde I wonder how it never came up before. Looks pretty good @SergeyBiryukov

#12 @SergeyBiryukov
4 years ago

  • Keywords needs-patch added; has-patch removed

Let's make the text filterable.

@obrienlabs
4 years ago

Adds a filter on the description and moves the IS_PROFILE_PAGE down to only display the description on IS_PROFILE_PAGE, but always show the avatar on other user edit pages

#13 follow-up: @obrienlabs
4 years ago

  • Keywords has-patch added; needs-patch removed

I think it might make sense to have the avatar show when you access any user edit page, not just your own user edit page. So I'm attaching a new patch that moves the IS_PROFILE_PAGE conditional down a little to only display the description div when IS_PROFILE_PAGE is true.

I also (think) I've got the text filterable correct and hope I have the formatting correct, too. I didn't know where to add the filter callback, so I added it to the end of user-functions.php. I had to update the printf to sprintf when adding the filter portion. The printf was adding an integer to the end of the sentence.

This is my first time doing a patch submission, a little nervous and I sure hope I got everything right!

#14 in reply to: ↑ 13 @SergeyBiryukov
4 years ago

  • Keywords commit added

Replying to obrienlabs:

This is my first time doing a patch submission, a little nervous and I sure hope I got everything right!

Looks good, just two things:

  • No need for the callback function, apply_filters() is enough.
  • New filters need to be documented as per the documentation standards.

I also think we should always apply the filter, so that plugin authors could alter the text displayed for other users too if they want.

See 32286.2.patch.

#15 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 35610:

Users: Add user's Gravatar to 'About the user' section on user profile page.

Add user_profile_picture_description filter for the description text displayed under the Gravatar.

Props carolinegeven, obrienlabs, SergeyBiryukov.
Fixes #32286.

#16 @ocean90
4 years ago

Should the section be hidden if the show_avatars setting is disabled?

#17 @SergeyBiryukov
4 years ago

In 35613:

Users: Only show the profile picture if 'Show Avatars' option in Discussion Settings is enabled.

Props ocean90.
See #32286.

Note: See TracTickets for help on using tickets.