Restore code that returns the existing media object if it already exists.
props programmin, adamsilverstein. fixes #24062 git-svn-id: http://core.svn.wordpress.org/trunk@24447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3231e8cbd0
commit
e1923d4783
|
@ -539,6 +539,9 @@
|
||||||
add: function( id, options ) {
|
add: function( id, options ) {
|
||||||
var workflow = this.get( id );
|
var workflow = this.get( id );
|
||||||
|
|
||||||
|
if ( workflow ) // only add once: if exists return existing
|
||||||
|
return workflow;
|
||||||
|
|
||||||
workflow = workflows[ id ] = wp.media( _.defaults( options || {}, {
|
workflow = workflows[ id ] = wp.media( _.defaults( options || {}, {
|
||||||
frame: 'post',
|
frame: 'post',
|
||||||
state: 'insert',
|
state: 'insert',
|
||||||
|
|
Loading…
Reference in New Issue