Changeset 12110 for sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/user.php
- Timestamp:
- 10/07/2022 07:42:52 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/user.php
r12057 r12110 19 19 */ 20 20 const MAX_PENDING_SUBMISSIONS = 5; 21 22 /** 23 * The number of published posts before a given user is permitted to toggle 24 * all of the confirmation checkboxes when submitting a photo. 25 * 26 * @var int 27 */ 28 const TOGGLE_ALL_THRESHOLD = 30; 21 29 22 30 public static function init() { … … 89 97 } 90 98 99 /** 100 * Determines if a user is eligible to toggle all confirmation checkboxes on 101 * the photo upload form. 102 * 103 * The intent is that users who have submitted a decent number of published 104 * photos are as aware of the listed criteria as they're going to be and have 105 * demonstrated that they are able to abide by them. 106 * 107 * @todo Handle eventual case when a new checkbox is added or one is changed 108 * enough to warrant making the user manually re-check the checkboxes. 109 * The latest checkbox update date can be stored as a constant and, if 110 * set, the contributor must also have a post (or N posts) published 111 * after that date to requalify for the bulk toggle. 112 * 113 * @param int $user_id Optional. The user ID. If not defined, assumes current 114 * user. Default false. 115 * @return bool True if user can toggle confirmation checkboxes, else false. 116 */ 117 public static function can_toggle_confirmation_checkboxes( $user_id = false ) { 118 $can = false; 119 120 if ( ! $user_id ) { 121 $user_id = get_current_user_id(); 122 } 123 124 if ( $user_id && self::count_published_photos( $user_id ) >= self::TOGGLE_ALL_THRESHOLD ) { 125 $can = true; 126 } 127 128 return $can; 129 } 130 91 131 } 92 132
Note: See TracChangeset
for help on using the changeset viewer.