Home Forums Plugin Support WP User Frontend Pro Change redirection link if new post is created

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  towhid 3 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41947

    joshi
    Member
    Post count: 18

    Hello,

    After creating a new post in the frontend, the user should be redirected to the post he just created. I can set this in the WPUF settings, and it works fine.

    I want to add a success message too, so I want to add “?action=newprofilecreated” to the url.

    Already found a code for that in the WP forum of your plugin, tried to change it but it didn't work:

    function some_callback( $post_url, $post_id ) {
    	$new_url=$post_url.'#newprofilecreated';
    	return $new_url;
    }
    add_filter( 'wpuf_after_post_redirect', 'some_callback', 10, 2 );

    Any ideas why?
    Thank you

    #41984

    towhid
    Participant
    Post count: 4505

    Hello Joshi,

    I need to know in which file you have tried out this code? Theme or plugin? ‘#newprofilecreated' is indicate what?

    Thank you:)

    #42020

    joshi
    Member
    Post count: 18

    Hello towhid,

    I put this code in the functions.php of the theme
    Sorry, The code is “?action=newprofilecreated” instead of “#newprofilecreated”. I use this GET-Variable to display a success message on the page with the new created post of the user.

    I have set the WPUF form to be redirected to the “newly created post”, which works fine.
    What I want is just adding “?action=newprofilecreated” to this url.

    function some_callback( $post_url, $post_id ) {
    	$new_url=$post_url.'?action=newprofilecreated';
    	return $new_url;
    }
    add_filter( 'wpuf_after_post_redirect', 'some_callback', 10, 2 );

    Thank you

    #42233

    towhid
    Participant
    Post count: 4505

    Hello Joshi,

    I am really sorry to say that wpuf_after_post_redirect filter does not works in WP User Frontend Pro version.

    Thank you ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Change redirection link if new post is created’ is closed to new replies.