Info
- 2 posts
- 2 voices
- Started 8 months ago by jczerwonka
- Latest reply from John James Jacoby
- This topic is not resolved
Subforum list not displaying if all subforums are private
-
- Posted 8 months ago #
It seems bbp_get_forum_subforum_count() does not return private forums. So when all the subforums are private, this funcion returns 0 which causes the list forums function to bail.
I got it around it by creating the following filter to count the forums:
add_filter( 'bbp_get_forum_subforum_count', 'my_subforum_count', 3 ); function my_subforum_count( $forum_count, $forum_id ) { $subforums = bbp_forum_get_subforums( array( 'post_parent' => $forum_id ) ); return count( $subforums ); }Please advise if you'd like me to create a trac ticket for this. I didn't want to create a ticket in case it already exists or I'm just doing something wrong.
Thanks,
John -
- Posted 8 months ago #
This was by design to avoid querying each forum for it's children on each page load if it didn't have any children.
The '_bbp_forum_subforum_count' post meta only contains a count of public forums, as returned by bbp_forum_query_subforum_ids() which uses bbp_get_public_child_ids().
Now that forum status is baked into the query filter, this kind of check could probably use a rethink. Go ahead and open a ticket and I'll look at it for 2.1.
-
You must log in to post.