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,