[wp-trac] [WordPress Trac] #32899: Ability to extend Attachment Display Settings section

WordPress Trac noreply at wordpress.org
Mon Jul 6 21:32:44 UTC 2015


#32899: Ability to extend Attachment Display Settings section
---------------------------+-----------------------------
 Reporter:  paulschreiber  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Media          |    Version:  4.2.2
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 It would be very helpful if WordPress let you easily extend the Attachment
 Display Settings section.

 Currently, if you extend `wp.media.view.Attachment.Details`, your
 `render()` call gets access to `this.$el`, something like
 {{{
 <div tabindex="0" data-id="75099" class="attachment-details save-ready">
 ...
 }}}

 However, the DOM doesn't yet contain the attachment settings, i.e.
 {{{
 <div class="attachment-display-settings">
 <h3>Attachment Display Settings</h3>
 ...
 }}}

 I had to use a crappy workaround like this:
 {{{
 setTimeout(function() {
   jQuery('.attachment-display-settings').append( wp.media.template('my-
 attachment-display-settings')({}) );
   }, 200);
 }}}

 It would be very helpful if there was an easy way to extend the display
 settings section. One such way could be to fire an event after the render
 completes.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32899>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list