Changeset 13786 for sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php
- Timestamp:
- 06/07/2024 04:46:11 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php
r12959 r13786 613 613 } 614 614 615 // Flag if user has past rejections. 616 $rejections = Rejection::get_user_rejections( $post->post_author ); 617 if ( $rejections ) { 618 $rejections_count = count( $rejections ); 619 620 // Don't count submission errors. 621 $submission_errors_count = array_reduce( $rejections, function ( $count, $item ) { 622 $reason = Rejection::get_rejection_reason( $item ); 623 if ( 'submission-error' === $reason ) { 624 $count++; 625 } 626 return $count; 627 }, 0 ); 628 $rejections_count -= $submission_errors_count; 629 630 if ( $rejections_count > 0 ) { 615 // Flag if user has notable number of past rejections. 616 $rejections_count = User::count_rejected_photos( $post->post_author ); 617 if ( $rejections_count ) { 631 618 $rejections_level = $message = ''; 632 619 … … 657 644 $flags[ sprintf( $message, round( $rejections_percentage * 100 , 0 ) ) ] = $rejections_level; 658 645 } 659 }660 646 } 661 647
Note: See TracChangeset
for help on using the changeset viewer.