Changeset 12057 for sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php
- Timestamp:
- 09/08/2022 08:21:21 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php
r11715 r12057 54 54 // Modify admin menu links for photo posts. 55 55 add_action( 'admin_menu', [ __CLASS__, 'modify_admin_menu_links' ] ); 56 }57 58 /**59 * Returns the count of the number of photo submissions from a user that were rejected.60 *61 * @param int $user_id The user ID.62 * @return int63 */64 public static function count_user_rejections( $user_id ) {65 global $wpdb;66 67 return (int) $wpdb->get_var( $wpdb->prepare(68 "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = %s AND post_status = %s AND post_author = %d",69 Registrations::get_post_type(),70 Rejection::get_post_status(),71 $user_id72 ) );73 56 } 74 57 … … 533 516 . sprintf( 534 517 __( 'Approved: <strong>%s</strong>', 'wporg-photos' ), 535 sprintf( '<a href="%s">%d</a>', $approved_link, Photo::count_user_published_photos() )518 sprintf( '<a href="%s">%d</a>', $approved_link, User::count_published_photos() ) 536 519 ) 537 520 . "</div>\n"; 538 521 539 522 // Show number of pending photos if there are any. 540 $pending_count = Photo::count_user_pending_photos();523 $pending_count = User::count_pending_photos(); 541 524 if ( $pending_count ) { 542 525 $pending_link = add_query_arg( [ … … 763 746 764 747 $author = get_user_by( 'id', $post->post_author ); 765 $photos_count = Photo::count_user_published_photos( $author->ID );748 $photos_count = User::count_published_photos( $author->ID ); 766 749 $account_created = explode( ' ', $author->user_registered )[0]; 767 750 ?> … … 801 784 ?></li> 802 785 <li><?php 803 $rejected_count = self::count_user_rejections( $author->ID );786 $rejected_count = User::count_rejected_photos( $author->ID ); 804 787 $link_args = [ 805 788 'post_type' => Registrations::get_post_type(), … … 816 799 ?></li> 817 800 <li><?php 818 $pending_count = Photo::count_user_pending_photos( $author->ID );801 $pending_count = User::count_pending_photos( $author->ID ); 819 802 $link_args = [ 820 803 'post_type' => Registrations::get_post_type(),
Note: See TracChangeset
for help on using the changeset viewer.