Notifications
Clear all

How to change redirect URL after Reply?

3 Posts
2 Users
0 Likes
214 Views
Posts: 2
Topic starter
(@xyzha)
New Member
Joined: 8 months ago

Hi everyone!

I changed the order of my forum:

add_filter('wpforo_post_list_args', function ($args){
if(!empty($args)){
$args['orderby'] = 'created DESC, postid DESC';
}
return $args;
});

Β After that I have a trouble at the reply and the redirect. How can I redirect the user to the first page of the replied topic (to show your own reply)?Β 

Currently, my redirect URL looks like : "https://domain.xx/forum/uzenofal/teszte-topic/paged/2/#post-38776/" --> Its could by fine without "/paged/2/" part, because our new replies are on the first page.Β 

I have a code for redirect to the parent URL, but it doesnt works:

function redirect_to_first_page( $url, $post ) {

$topic_url = get_permalink( $post->post_parent );
return $topic_url . '?wpforo=page1';

}

add_filter( 'wpforo_reply_add_redirect_url', 'redirect_to_first_page', 10, 2 );

I hope you can help me in this matter!

Thanks a lot!

Β 

wpForo Version
2.1.5
WordPress Version
6.1.1
2 Replies
Posts: 2
Topic starter
(@xyzha)
New Member
Joined: 8 months ago

Any idea? πŸ™

Reply
1 Reply
Admin
(@chris)
Joined: 2 years ago

Support Team
Posts: 3653

Hi @xyzha,

Sorry for the late response, your question has been sent to the Devs, that's why it took time to give an answer.Β 

wpForo Doesn't have that hook which you added in the code and because of that, your code doesn't work.

'wpforo_reply_add_redirect_url'

And also, we have set under consideration to create hooks with paths for the front end actions before the redirection.

Reply