From db30495fcd25cc5c7bca1b9f242590f365d40050 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Fri, 9 Nov 2012 12:09:15 +0000 Subject: [PATCH] Media: Correctly set the edit gallery's library. see #21390. git-svn-id: http://core.svn.wordpress.org/trunk@22506 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/media-views.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 9a6aca9c3d..01d472c536 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -502,6 +502,10 @@ }, initialize: function() { + // If we haven't been provided a `library`, create a `Selection`. + if ( ! this.get('library') ) + this.set( 'library', new media.model.Selection() ); + // The single `Attachment` view to be used in the `Attachments` view. if ( ! this.get('AttachmentView') ) this.set( 'AttachmentView', media.view.Attachment.Gallery ); @@ -846,6 +850,7 @@ // Gallery states. new media.controller.Gallery({ + library: options.selection, editing: options.editing, menu: 'gallery' }),