After re-reading my original request, it seems a bit vague so let me clarify:
After entering a new forum post and clicking “Post”, I am looking to display the topic index of the forum that was posted to.
Ditto for a reply to a post.
Hopefully this can be achieved with a small modification in the child theme functions.php ?
Thanks in advance for any help.
Dennis
yes, this should work – add this to the functions file in your child theme
add_filter( 'bbp_new_topic_redirect_to', 'rew_forum_redirect_topic' , 10 ,3 ) ;
add_filter( 'bbp_new_reply_redirect_to', 'rew_forum_redirect_reply' , 10 ,3 ) ;
function rew_forum_redirect_topic ($redirect_url, $redirect_to, $topic_id ){
$forum_id = bbp_get_topic_forum_id($topic_id);
$redirect_url = bbp_get_forum_permalink( $forum_id ) ;
return $redirect_url ;
}
function rew_forum_redirect_reply ($redirect_url, $redirect_to, $reply_id ){
$forum_id = bbp_get_reply_forum_id($reply_id);
$redirect_url = bbp_get_forum_permalink( $forum_id ) ;
return $redirect_url ;
}
Thanks Robin – that worked perfectly. BTW I just discovered the style pack – excellent stuff 🙂
Thanks again,
Dennis
I’m about to add this as a function within the style pack !
It’s working perfectly for me. Actually, i want the user to redirect to /members/member_name/forums/ after submitting a new topic so here are my changes.
function rew_forum_redirect_topic ($redirect_url, $redirect_to, $topic_id ){
$forum_id = bbp_get_topic_forum_id($topic_id);
$redirect_url = bp_loggedin_user_domain() . ‘forums/’ ;
return $redirect_url ;
}
add_filter( ‘bbp_new_topic_redirect_to’, ‘rew_forum_redirect_topic’ , 10 ,3 ) ;