Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#32765 closed enhancement (duplicate)

Allow custom Customizer controls to use the WordPress core Cropper with custom dimensions

Reported by: imath's profile imath Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch
Focuses: Cc:



I've been exploring the WP Site Icon plugin by John Blackbourn, and i've noticed the Cropper was using a "hardcoded" ajax action set to custom-header-crop.
I think if any custom Customizer control needs to use the Media Editor and the cropper feature (just like the WP Site Icon), it would be interesting to add a parameter to the cropper control to set the ajax action. Else, the image will always be cropped using the custom header dimensions.

The attached patch contains my suggestion.

I've read that #29211 "should be tackled before the site icon functionality" but i haven't seen in the latest patch attached to it something about this possible enhancement. I've forked and will soon submit a pull request to John containing my suggestions about WP Site Icon, you can see how this enhancement could benefit to WP Site Icon into these two files:

Attachments (1)

32765.patch (1.5 KB) - added by imath 8 years ago.

Download all attachments as: .zip

Change History (5)

8 years ago

#1 @johnbillion
8 years ago

  • Keywords has-patch added
  • Version trunk deleted

cc @obenland @markoheijnen @celloexpressions

#2 @markoheijnen
8 years ago

That was my next step with #29211 but was sick during the weekend. I was thinking more difficult by splitting the logic also on the AJAX side since thats needed there since someone could use WP_Customize_Cropped_Image_Control directly.

Why I'm not directly a fan of this approach, I can understand why we would go with this approach. Earliest I can be done with that ticket is this weekend.

#3 @imath
8 years ago

Hi @markoheijnen

Sorry to read you were sick, hope you're feeling better. Thank you for your comment: it made me think!
I've quickly made some tests on a new branch of my fork and i think my suggested patch is actually not needed ;)

I symply needed to extend the cropper and use this extended version in the plugin.

Thanks a lot for your time. Feel free to close this ticket unless you think it's still worth some attention.

#4 @celloexpressions
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Going to close this for now then and port the relevant code over to #29211.

Note: See TracTickets for help on using tickets.