Making WordPress.org

Changeset 13205


Ignore:
Timestamp:
02/12/2024 10:11:54 PM (11 months ago)
Author:
coffee2code
Message:

Photo Directory, Admin: Prevent randomization of the queue if it's explicitly being sorted.

Props mbigul, coffee2code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php

    r13171 r13205  
    15091509     * Randomizes the list of posts in the queue.
    15101510     *
    1511      * Note: Can be disabled via query string: ?random=0
     1511     * Note: Can be disabled if explicitly sorting via a post field or via query string: ?random=0
    15121512     */
    15131513    public static function randomize_the_queue( $query ) {
     
    15161516        }
    15171517
    1518         // Don't randomize if disabled via query parameter.
     1518        // Bail if disabled via query parameter.
    15191519        if ( '0' === $query->get( 'random' ) ) {
     1520            return;
     1521        }
     1522
     1523        // Bail if already explicitly sorting by a post field.
     1524        if ( ! empty( $_GET['orderby'] ) && 'random' !== $_GET['orderby'] ) {
    15201525            return;
    15211526        }
Note: See TracChangeset for help on using the changeset viewer.