-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix/135 Re-adding "Square" Crop ability #136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The skip cropping button remains in place (which actually uses the default square crop during testing), was that intentional? I am presuming it is and approving the change for now.
@peterwilsoncc Thanks for raising this point, this seems similar mentioned by @dinhtungdu in #131 (comment). Even if a user skips the crop, the end result will still be in the (default) square. WordPress displays an avatar in its appropriate/nearest scaled size at FE, we are also using the same avatar size that is found in the arguments passed to
If a user crops avatar, a cropped image's scaled version is displayed at FE "vs", If cropping is skipped, the original image's scaled version is displayed. In either case, the scaled (or we can say "cropped") image is displayed at FE. This is WP's default behavior. Now the question is - are we supposed to display an 'original' size avatar when the user clicks "Skip Cropping"? In that case, we have to add a new user meta that stores whether the avatar is cropped or not. And conditionally skip passing the size in the above code and use something like this:
I have uploaded and set a 460 x 6358 (vertical) avatar image and used the 'original' version (by using the above code statically), and here are the results. IMO, we should not change the WP's default behavior of displaying avatars at the front end (by displaying 'original' sized avatars) and keep using the "default" crop/scaled version of Avatar. However, I'm concerned users may get confused about why the avatar is in default cropped mode even if they have clicked "Skip Crop". @dkotter @jeffpaul - please share your thoughts, is it fine to keep using the scaled avatar images by WordPress at the front end (even when the user chooses the "Skip cropping" while setting up an avatar in the backend? |
This makes sense. How about instead of "Skip Crop" the text is changed to "Default Crop". This can be discussed on another ticket as this PR covers a different change. |
@peterwilsoncc the "Skip Crop" is coming from the core and I didn't find a way to overwrite it. EDIT: Found the filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks.
Description of the Change
Closes #135
Alternate Designs
n/a
Possible Drawbacks
Maybe in the future, we get some users wanting the freeform crop ability.
Verification Process
wp-admin/customize.php?return=%2Fwp-admin%2Fprofile.php
), the button name should be "Skip Crop".Checklist:
Changelog Entry
Credits
Props @dkotter @dinhtungdu @faisal-alvi