From cc58e827f35a014d02c3a2d9356385abb1f7a117 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: https://develop.svn.wordpress.org/trunk@22506 602fd350-edb4-49c9-b593-d223f7449a82 --- 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' }),