From fb97e258f905927fcd0bb5f8a525574202f47ac6 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 19 Jun 2013 21:55:17 +0000 Subject: [PATCH] Restore code that returns the existing media object if it already exists. props programmin, adamsilverstein. fixes #24062 git-svn-id: https://develop.svn.wordpress.org/trunk@24447 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/media-editor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 7c96148527..3fa20a6ab9 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -539,6 +539,9 @@ add: function( id, options ) { var workflow = this.get( id ); + if ( workflow ) // only add once: if exists return existing + return workflow; + workflow = workflows[ id ] = wp.media( _.defaults( options || {}, { frame: 'post', state: 'insert',