Making WordPress.org

Changeset 12549


Ignore:
Timestamp:
04/20/2023 08:15:20 PM (18 months ago)
Author:
coffee2code
Message:

Photo Directory, Posts: Default to finding next post in queue by date rather than randomly.

Fixes #6741.

File:
1 edited

Legend:

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

    r12384 r12549  
    289289     *
    290290     * @param string $orderby The field to order posts by when determining the
    291      *                        next post in queue. Default 'rand'.
     291     *                        next post in queue. Default 'date'.
    292292     * @param string $order   The sort order used when determining the next post
    293293     *                        in queue. Either 'ASC' or 'DESC'. Default 'ASC'.
     
    295295     *                       available for the user to moderate.
    296296     */
    297     public static function get_next_post_in_queue( $orderby = 'rand', $order = 'ASC' ) {
     297    public static function get_next_post_in_queue( $orderby = 'date', $order = 'ASC' ) {
    298298        $next = false;
    299299
     
    312312            'post_status'    => 'pending',
    313313            'post_type'      => Registrations::get_post_type(),
     314            'meta_query'     => [
     315                'relation'   => 'OR',
     316                [
     317                    'key'     => '_edit_lock',
     318                    'compare' => 'NOT EXISTS',
     319                ],
     320                [
     321                    'key'     => '_edit_lock',
     322                    'value'   => '',
     323                    'compare' => '='
     324                ],
     325            ],
    314326        ] );
    315327
Note: See TracChangeset for help on using the changeset viewer.