bbp_get_user_reply_count_raw( $user_id )

Return the raw database count of replies by a user

Description

Return

(int) Raw DB count of replies

Source

File: bp-forums/users/functions.php

169
170
171
172
173
174
175
176
177
178
179
180
function bbp_get_user_reply_count_raw( $user_id = 0 ) {
    $user_id = bbp_get_user_id( $user_id );
    if ( empty( $user_id ) )
        return false;
 
    global $wpdb;
 
    $where = get_posts_by_author_sql( bbp_get_reply_post_type(), true, $user_id );
    $count = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} {$where}" );
 
    return (int) apply_filters( 'bbp_get_user_reply_count_raw', $count, $user_id );
}

Changelog

Changelog
Version Description
bbPress (r3633) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.