Making WordPress.org

Changeset 13790

Timestamp:
06/07/2024 05:29:29 AM (22 months ago)
Author:
coffee2code
Message:

Photo Directory, User: Increase concurrent submission limit to 10 for frequent contributors (those with 30+ published photos).

Props ChrisEdwardsCE, topher1kenobe, coffee2code.
Fixes #6524.

File:
1 edited

Legend:

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

    r13788 r13790  
    1111
    1212    /**
    13      * Maximum number of pending/concurrent submissions.
     13     * Maximum number of pending/concurrent submissions.
    1414     *
    1515     * Once this threshold is met, a user will be unable to make another
     
    2424
    2525    /**
    26      * The number of published posts before a given user is permitted to toggle
    27      * all of the confirmation checkboxes when submitting a photo.
    28      *
     26     * Maximum number of pending/concurrent submissions for frequent contributors.
     27     *
     28     * Once this threshold is met, a user will be unable to make another
     29     * submission until a current submission is approved or rejected.
     30     *
     31     * @see `get_concurrent_submission_limit()` for actually retrieving the maximum
     32     * pending submissions for a user, since it can vary based on the user and may
     33     * be filtered.
    2934     * @var int
    3035     */
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
    3148    const TOGGLE_ALL_THRESHOLD = 30;
    3249
     50
     51
     52
    3353    public static function init() {
    3454    }
     
    344364
    345365    /**
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
    346387     * Determines if a user is eligible to toggle all confirmation checkboxes on
    347388     * the photo upload form.
     
    362403     */
    363404    public static function can_toggle_confirmation_checkboxes( $user_id = false ) {
    364         $can = false;
    365 
    366         if ( ! $user_id ) {
    367             $user_id = get_current_user_id();
    368         }
    369 
    370         if ( $user_id && self::count_published_photos( $user_id ) >= self::TOGGLE_ALL_THRESHOLD ) {
    371             $can = true;
    372         }
    373 
    374         return $can;
     405        return self::is_frequent_contributor( $user_id );
    375406    }
    376407
     
    391422        }
    392423
    393         return apply_filters( 'wporg_photos_max_concurrent_submissions', self::MAX_PENDING_SUBMISSIONS, $user_id );
     424        $limit = self::is_frequent_contributor( $user_id )
     425            ? self::MAX_PENDING_SUBMISSIONS_FREQUENT
     426            : self::MAX_PENDING_SUBMISSIONS;
     427
     428        return apply_filters( 'wporg_photos_max_concurrent_submissions', $limit, $user_id );
    394429    }
    395430
Note: See TracChangeset for help on using the changeset viewer.