Making WordPress.org


Ignore:
Timestamp:
07/10/2023 10:30:23 PM (17 months ago)
Author:
coffee2code
Message:

Photo Directory, User: Count 'flagged' photos towards submission count.

Also, reduce redundancy by using count_pending_photos().

See #7119.

File:
1 edited

Legend:

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

    r12726 r12727  
    237237        if ( $user_id ) {
    238238            $max_pending_submissions = self::get_concurrent_submission_limit( $user_id );
    239             $posts = get_posts( [
    240                 'fields'         => 'ids',
    241                 'posts_per_page' => $max_pending_submissions,
    242                 'author'         => $user_id,
    243                 'post_status'    => 'pending',
    244                 'post_type'      => Registrations::get_post_type(),
    245             ] );
    246 
    247             if ( count( $posts ) < $max_pending_submissions ) {
     239            $pending_photos_count = self::count_pending_photos( $user_id );
     240
     241            if ( $pending_photos_count < $max_pending_submissions ) {
    248242                $limit_reached = false;
    249243            }
Note: See TracChangeset for help on using the changeset viewer.