From 199edff3b42b778cd28903d4b928436a778657ce Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Fri, 9 Nov 2012 12:14:48 +0000 Subject: [PATCH] Media: When printing a gallery shortcode, hide the implicit orderby value. see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22507 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/mce-view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index cb1ce2a87c..efc051ac94 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -639,6 +639,11 @@ window.wp = window.wp || {}; attrs.ids = attachments.pluck('id'); + // If the `ids` attribute is set and `orderby` attribute + // is the default value, clear it for cleaner output. + if ( attrs.ids && 'post__in' === attrs.orderby ) + delete attrs.orderby; + shortcode = new wp.shortcode({ tag: 'gallery', attrs: attrs,