PluginProbe
Private groups / 2.3
Private groups v2.3
trunk 1.5 1.6 1.7 1.8 1.8.1 1.9.1 1.9.2 2.0 2.0.1 2.2 2.3 2.4 2.5 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 All 116 releases
← All changes | includes/topics.php +8 -2 1.72.3 View file →
@@ -1,10 +1,15 @@
1 1 <?php
2 2
3 +//version 1.9.2 fixed private groups forums for subscriptions
4 +
3 5 add_filter ('bbp_before_has_topics_parse_args', 'pg_has_topics') ;
4 6
5 7 function pg_has_topics( $args = '' ) {
6 -
8 + //check if being called by subscriptions and if so skip filtering (as you can only subscribe to forums you can already see)
9 + if($args['post__in']) {
10 + return $args ;
11 + }
7 12 $default_post_parent = bbp_is_single_forum() ? bbp_get_forum_id() : 'any';
8 13
9 14 if ($default_post_parent == 'any') {
10 15 if ( bbp_is_user_keymaster()) return $args;
@@ -37,9 +42,10 @@
37 42
38 43 //Loop through all the posts
39 44 foreach ( $post_ids as $post_id ) {
40 45 //Get the Forum ID based on Post Type Topic
41 - $forum_id = private_groups_get_forum_id_from_post_id($post_id, 'topic');
46 + $topic=bbp_get_topic_post_type() ;
47 + $forum_id = private_groups_get_forum_id_from_post_id($post_id, $topic);
42 48 //Check if User has permissions to view this Post ID
43 49 //by calling the function that checks if the user can view this forum, and hence this post
44 50 if (private_groups_can_user_view_post_id($forum_id)) {
45 51