WordPress.org

Make WordPress Core

Changeset 25720


Ignore:
Timestamp:
10/07/2013 07:01:48 PM (7 years ago)
Author:
nacin
Message:

Prevent the removal of a manual 'orderby' attribute in the gallery shortcode.

props nofearinc.
fixes #24868.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-editor.js

    r24777 r25720  
    237237
    238238                // Mark the `orderby` override attribute.
     239                if( undefined !== attrs.orderby )
     240                    attrs._orderByField = attrs.orderby;
     241
    239242                if ( 'rand' === attrs.orderby )
    240243                    attrs._orderbyRandom = true;
     
    284287
    285288                // Check if the gallery is randomly ordered.
     289                delete attrs.orderby;
     290
    286291                if ( attrs._orderbyRandom )
    287292                    attrs.orderby = 'rand';
     293                else if ( attrs._orderByField && attrs._orderByField != 'rand' )
     294                    attrs.orderby = attrs._orderByField;
     295
    288296                delete attrs._orderbyRandom;
     297                delete attrs._orderByField;
    289298
    290299                // If the `ids` attribute is set and `orderby` attribute
Note: See TracChangeset for help on using the changeset viewer.