Reply To: I want to get the parent forum name/ID of any topic
I am writing this code in functions.php and when I am trying to dump data using
print_r (bbp_get_topic_id());
It is returning 0.
When the above mentioned condition is met I will redirect to another page.
function test_rdr (){
if (bbp_get_topic_forum_id(bbp_get_topic_id()) == ‘ID of the Parent forum’){
wp_redirect('/test-page');
exit;
}
}
add_action('template_redirect', 'test_rdr')
Please help me to get over with it.