[wp-trac] [WordPress Trac] #23096: Provide callback before setting state of the editor media manager

WordPress Trac noreply at wordpress.org
Tue Jan 1 18:09:37 UTC 2013


#23096: Provide callback before setting state of the editor media manager
------------------------------------+------------------------------
 Reporter:  griffinjt               |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Media                   |     Version:  trunk
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> In the current setup, there is no way to modify the current state or
> views when the media manager is opened from the "Add Media" button. By
> the time you can modify anything, all the default views have been
> rendered and all of the events have been fired.
>
> It would be helpful to check for the existence of a callback, and if it
> exists, run that before returning the workflow.
>
> My patch does this, which you could invoke in this way:
>
> ```wp.media.editor.extend = function(workflow){
>         // Manipulate the workflow here
> }```
>
> Thoughts? This is only for the default media manager that is invoked by
> clicking the Add Media button.

New description:

 In the current setup, there is no way to modify the current state or views
 when the media manager is opened from the "Add Media" button. By the time
 you can modify anything, all the default views have been rendered and all
 of the events have been fired.

 It would be helpful to check for the existence of a callback, and if it
 exists, run that before returning the workflow.

 My patch does this, which you could invoke in this way:
 {{{
 wp.media.editor.extend = function(workflow){
         // Manipulate the workflow here
 }
 }}}

 Thoughts? This is only for the default media manager that is invoked by
 clicking the Add Media button.

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23096#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list