Changes between Initial Version and Version 2 of Ticket #3196
- Timestamp:
- 03/24/2018 07:58:59 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3196
-
Property
Milestone
changed from
2.6
to2.8
-
Property
Type
changed from
defect
toenhancement
-
Property
Summary
changed from
Hidden counters no longer visible in bbp_get_statistics
toImprove bbp_get_statistics() to use registered statuses
-
Property
Milestone
changed from
-
Ticket #3196 – Description
initial v2 1 $stats = bbp_get_statistics(); 2 var_dump($stats); 1 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... 3 2 4 2.6 RC-5 5 array(12) { ["user_count"]=> string(2) "31" ["user_count_int"]=> int(31) ["forum_count"]=> string(1) "7" ["forum_count_int"]=> int(7) ["topic_count"]=> string(2) "60" ["topic_count_int"]=> int(60) ["reply_count"]=> string(3) "120" ["reply_count_int"]=> int(120) ["topic_tag_count"]=> string(1) "2" ["topic_tag_count_int"]=> int(2) ["hidden_topic_title"]=> string(0) "" ["hidden_reply_title"]=> string(0) "" } 3 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.) 6 4 7 2.6 Beta2 8 array(18) { ["user_count"]=> string(2) "31" ["user_count_int"]=> int(31) ["forum_count"]=> string(1) "7" ["forum_count_int"]=> int(7) ["topic_count"]=> string(2) "60" ["topic_count_int"]=> int(60) ["topic_count_hidden"]=> string(1) "0" ["topic_count_hidden_int"]=> int(0) ["reply_count"]=> string(3) "120" ["reply_count_int"]=> int(120) ["reply_count_hidden"]=> string(1) "0" ["reply_count_hidden_int"]=> int(0) ["topic_tag_count"]=> string(1) "2" ["topic_tag_count_int"]=> int(2) ["empty_topic_tag_count"]=> string(1) "0" ["empty_topic_tag_count_int"]=> int(0) ["hidden_topic_title"]=> string(0) "" ["hidden_reply_title"]=> string(0) "" } 5 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.