Ticket #24868: 24868.diff
File 24868.diff, 1.0 KB (added by , 10 years ago) |
---|
-
wp-includes/js/media-editor.js
236 236 args.perPage = -1; 237 237 238 238 // Mark the `orderby` override attribute. 239 if( undefined !== attrs.orderby ) 240 attrs.orderByField = attrs.orderby; 241 239 242 if ( 'rand' === attrs.orderby ) 240 243 attrs._orderbyRandom = true; 241 244 … … 281 284 // Copy the `uploadedTo` post ID. 282 285 if ( props.uploadedTo ) 283 286 attrs.id = props.uploadedTo; 284 287 285 288 // Check if the gallery is randomly ordered. 289 delete attrs.orderby; 290 286 291 if ( attrs._orderbyRandom ) 287 292 attrs.orderby = 'rand'; 293 else if ( attrs.orderByField && attrs.orderByField != 'rand' ) 294 attrs.orderby = attrs.orderByField; 295 288 296 delete attrs._orderbyRandom; 297 delete attrs.orderByField; 289 298 290 299 // If the `ids` attribute is set and `orderby` attribute 291 300 // is the default value, clear it for cleaner output.