From fb3d44da9b0d532d74d267231e44b0c37b49871b Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Tue, 20 Nov 2012 14:38:20 +0000 Subject: [PATCH] Media: Remove default gallery shortcode attributes when generating shortcode output. see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22715 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/media-upload.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js index c0d073a57d..c610106ed4 100644 --- a/wp-admin/js/media-upload.js +++ b/wp-admin/js/media-upload.js @@ -214,7 +214,6 @@ var tb_position; return { defaults: { order: 'ASC', - orderby: 'post__in', id: wp.media.view.settings.postId, itemtag: 'dl', icontag: 'dt', @@ -280,6 +279,12 @@ var tb_position; if ( attrs.ids && 'post__in' === attrs.orderby ) delete attrs.orderby; + // Remove default attributes from the shortcode. + _.each( wp.media.gallery.defaults, function( value, key ) { + if ( value === attrs[ key ] ) + delete attrs[ key ]; + }); + shortcode = new wp.shortcode({ tag: 'gallery', attrs: attrs,