Changeset 12057 for sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/photo.php
- Timestamp:
- 09/08/2022 08:21:21 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/photo.php
r11757 r12057 424 424 425 425 /** 426 * Returns a count of published photos for a user.427 *428 * @param int $user_id Optional. The user ID. If not defined, assumes global429 * author. Default false.430 * @return int431 */432 public static function count_user_published_photos( $user_id = false ) {433 if ( ! $user_id ) {434 global $authordata;435 436 $user_id = $authordata->ID;437 }438 439 return count_user_posts( $user_id, Registrations::get_post_type(), true );440 }441 442 /**443 * Returns a count of pending photos for a user.444 *445 * @param int $user_id Optional. The user ID. If not defined, assumes global446 * author. Default false.447 * @return int448 */449 public static function count_user_pending_photos( $user_id = false ) {450 if ( ! $user_id ) {451 global $authordata;452 453 $user_id = $authordata->ID;454 }455 456 $pending = get_posts( [457 'fields' => 'ids',458 'posts_per_page' => -1,459 'author' => $user_id,460 'post_status' => 'pending',461 'post_type' => Registrations::get_post_type(),462 ] );463 464 return count( $pending );465 }466 467 /**468 426 * Returns the full photo analysis data from cache or via API call. 469 427 *
Note: See TracChangeset
for help on using the changeset viewer.