Changeset 12695 for sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/user.php
- Timestamp:
- 07/03/2023 07:01:16 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/user.php
r12236 r12695 115 115 Registrations::get_post_type(), 116 116 Rejection::get_post_status(), 117 $user_id 118 ) ); 119 } 120 121 /** 122 * Returns a count of flagged photos for a user. 123 * 124 * @param int $user_id Optional. The user ID. If not defined, assumes global 125 * author. Default false. 126 * @return int 127 */ 128 public static function count_flagged_photos( $user_id = false ) { 129 global $wpdb; 130 131 if ( ! $user_id ) { 132 global $authordata; 133 134 $user_id = $authordata->ID; 135 } 136 137 return (int) $wpdb->get_var( $wpdb->prepare( 138 "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = %s AND post_status = %s AND post_author = %d", 139 Registrations::get_post_type(), 140 Flagged::get_post_status(), 117 141 $user_id 118 142 ) );
Note: See TracChangeset
for help on using the changeset viewer.