]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/media-editor.js
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-includes / js / media-editor.js
index fc497cd84dabc40d98e1fe633570859338c6508f..5e2a5fa6294f75f85f28dd3d77ca03ea611defbb 100644 (file)
                                args.perPage = -1;
 
                                // Mark the `orderby` override attribute.
+                               if( undefined !== attrs.orderby )
+                                       attrs._orderByField = attrs.orderby;
+
                                if ( 'rand' === attrs.orderby )
                                        attrs._orderbyRandom = true;
 
                                        attrs.id = props.uploadedTo;
 
                                // Check if the gallery is randomly ordered.
+                               delete attrs.orderby;
+
                                if ( attrs._orderbyRandom )
                                        attrs.orderby = 'rand';
+                               else if ( attrs._orderByField && attrs._orderByField != 'rand' )
+                                       attrs.orderby = attrs._orderByField;
+
                                delete attrs._orderbyRandom;
+                               delete attrs._orderByField;
 
                                // If the `ids` attribute is set and `orderby` attribute
                                // is the default value, clear it for cleaner output.