Last active
December 23, 2019 09:30
-
-
Save ideadude/b62daf1251f7b5ee0c1314cc728af6e9 to your computer and use it in GitHub Desktop.
Only redirect away from single topic and single reply pages in bbPress when running PMPro and PMPro bbPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Only redirect away from single topic and single reply pages. | |
Add this code to a custom plugin. | |
*/ | |
function wp_maybe_disable_pmprobbp_check_forum() { | |
global $post; | |
if(function_exists('bbp_is_topic') && !bbp_is_topic($post->ID) && !bbp_is_reply($post->ID)) { | |
remove_action( 'template_redirect', 'pmprobbp_check_forum' ); | |
remove_filter( 'pmpro_search_filter_post_types', 'pmprobb_pmpro_search_filter_post_types' ); | |
remove_filter( 'pre_get_posts', 'pmprobb_pre_get_posts' ); | |
} | |
} | |
add_action('template_redirect', 'wp_maybe_disable_pmprobbp_check_forum', 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment