From e1923d47835c7aeffea0951d6e5ca54d5fe37d32 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: http://core.svn.wordpress.org/trunk@24447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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',