Opened 7 years ago
Last modified 7 years ago
#3196 new enhancement
Improve bbp_get_statistics() to use registered statuses
Reported by: | casiepa | Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | General | Keywords: | |
Cc: |
Description (last modified by )
The bbp_get_statistics()
function is one of our oldest, and is used to populate the "At a Glance" Dashboard meta-box with counts for forums, topics, replies, etc...
Internally, this function does not care about what statuses are made available to post types, but rather is hard-coded to only support specific post types (the purpose of the original function was to only show public counts.)
Though custom post status support is still not completely implemented inside of WordPress, we do include our own helper functions for getting the appropriate statuses for them. We should use these functions, objects, and labels, to show counts by status for what the user is able to view. We should also cache these results based on the combination of counts made available to the user, so these statistics can be used in a more traditional forum type way.
Found it: r6542
We're using
array_filter()
on the$counts
array to remove keys with empty values.bbp_filter_dashboard_glance_items()
specifically does not count a bunch of private/hidden statuses.I would like to repurpose this issue into one that we can use to refactor
bbp_get_statistics()
to use known & registered statuses instead of hardcoding each of them as they are and have been.