Opened 3 years ago
Last modified 12 hours ago
#3457 new defect (bug)
bbp_get_total_users is wrong on multisite
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | API | Keywords: | has-patch needs-testing |
Cc: |
Description
bbp_get_total_users returns the total number of use4rs in the wordpress database. But this is extremely confusing on multisite as this is not the actual number of users on the site. Why not use:
$user_count = count_users();
return apply_filters( 'bbp_get_total_users', (int) $user_counttotal_users? );
This would lead to a much more logical number that does not confuse local administrators
Change History (3)
This ticket was mentioned in PR #16 on bbpress/bbPress by @khokansardar.
14 months ago
#2
- Keywords has-patch added
#4
@
12 hours ago
- Milestone changed from Awaiting Review to 2.8
This is intended, at least for now.
bbp_get_total_users()
is used internally by bbp_is_large_install()
to help put some limits on database queries during the automated update process.
(Related: when bbPress switches its minimum WordPress version to 6.0.0 it can wrap get_user_count()
and wp_is_large_user_count()
instead.)
I think for the purpose of your PR (and displaying a count of forum users on a per-site basis) bbPress should have a new dedicated template function instead of changing the way that bbp_get_total_users()
works.
Something like: bbp_get_forum_users( $forum_id = 0, $site_id = 0, $context = 'all' )
that would allow it to be used flexibly later?
Trac: https://bbpress.trac.wordpress.org/ticket/3457