diff --git includes/forums/functions.php includes/forums/functions.php
index 050791d..881f669 100644
|
|
|
function bbp_repair_forum_visibility() { |
| 929 | 929 | // First, delete everything. |
| 930 | 930 | delete_option( '_bbp_private_forums' ); |
| 931 | 931 | delete_option( '_bbp_hidden_forums' ); |
| | 932 | |
| | 933 | /** |
| | 934 | * Don't search for both private/hidden statuses. Since 'pre_get_posts' is an |
| | 935 | * action, it's not removed by suppress_filters. We need to make sure that |
| | 936 | * we're only searching for the supplied post_status. |
| | 937 | * |
| | 938 | * @see https://bbpress.trac.wordpress.org/ticket/2512 |
| | 939 | */ |
| | 940 | remove_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', 4 ); |
| 932 | 941 | |
| 933 | 942 | // Next, get all the private and hidden forums |
| 934 | 943 | $private_forums = new WP_Query( array( |
| … |
… |
function bbp_repair_forum_visibility() { |
| 945 | 954 | 'post_status' => bbp_get_hidden_status_id(), |
| 946 | 955 | 'fields' => 'ids' |
| 947 | 956 | ) ); |
| | 957 | |
| | 958 | // Enable forum visibilty normalization |
| | 959 | add_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', 4 ); |
| 948 | 960 | |
| 949 | 961 | // Reset the $post global |
| 950 | 962 | wp_reset_postdata(); |