[wp-trac] [WordPress Trac] #30062: Add Hooks to Image Editor UI

WordPress Trac noreply at wordpress.org
Wed Oct 22 02:59:23 UTC 2014


#30062: Add Hooks to Image Editor UI
---------------------------------+---------------------------------
 Reporter:  ericmann             |       Owner:
     Type:  enhancement          |      Status:  new
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Media                |     Version:  4.0
 Severity:  normal               |  Resolution:
 Keywords:  has-patch has-tests  |     Focuses:  ui, administration
---------------------------------+---------------------------------

Comment (by tomauger):

 This is what I love and hate about this - two great patches by completely
 different contributor groups. I feel like Tesla here.

 I think the loaded/registered idea is very interesting. It doesn't map 1:1
 to the way we handle meta boxes, which may prompt some to consider it a
 bit confusing. But it's a cool approach.

 I do like the `add_default_imgedit_groups()` function, but I do prefer
 making the `register/add_imgedit_group` function a little more robust on
 the front-end rather than deferring everything to the back-end. See my
 version:


 {{{
 function add_image_edit_group( $id, $title, $callback, $tab = "default",
 $help_text = "", $class = "", $callback_args = null ){ //... }
 }}}

 I feel that this gives developers a little more flexibility, and in
 particular, allowing the $args through makes things a lot easier.

 Furthermore, my `do_imgedit_groups()` function makes things a little more
 DRY and keeps the Image Editor Group boxes more consistent. In your
 approach, you're forcing the theme/plugin dev to grok the complete
 structure of the Image Editor box, including the show/hide help
 javascript, the correct classes, etc.

 That stuff can (and likely will) change in core at some point, and we want
 ALL the boxes to look and behave as much the same as possible. So take
 that piece out of the developer's hands.

 In your version I'm not seeing a hook, other than
 'add_default_image_groups' where devs could officially hook their own
 Image Edit Groups onto, the way we have 'add_meta_boxes' for Meta Boxes.
 See my patch for a way you can do this, right before looping through the
 Editor Groups.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30062#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list