Changeset 6611
- Timestamp:
- 07/04/2017 01:57:26 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/functions.php
r6610 r6611 662 662 663 663 /** 664 * Return the raw database count of closed topics by a user665 *666 * @since 2.6.0 bbPress (r6113)667 *668 * @param int $user_id User ID to get count for669 *670 * @return int Raw DB count of user closed topics671 */672 function bbp_get_user_closed_topic_count( $user_id = 0 ) {673 $user_id = bbp_get_user_id( $user_id );674 $bbp_db = bbp_db();675 $count = (int) $bbp_db->get_var( $bbp_db->prepare(676 "SELECT COUNT(*)677 FROM {$bbp_db->posts}678 WHERE post_type = %s679 AND post_status = %s680 AND post_author = %d",681 bbp_get_topic_post_type(),682 bbp_get_closed_status_id(),683 $user_id684 ) );685 686 // Filter & return687 return (int) apply_filters( 'bbp_get_user_closed_topic_count', $count, $user_id );688 }689 690 /**691 664 * Bump the topic count for a user by a certain amount. 692 665 *
Note: See TracChangeset
for help on using the changeset viewer.