WP User Frontend
Redirect after editing post (6 posts)

  1. wombat86
    Posted 3 years ago #

    Hi. After a user edits a post, I am trying to redirect them to that post. Currently they are redirected to the same edit post form.

    I have tried adding different redirect codes to the wpuf-edit-post.php file but I can't get it to work.

    Thank you!


  2. laupie
    Posted 3 years ago #

    Hi Wombat86,

    This is exactly the functionality I'm looking for. Have you managed to get this working and if so, can you explain me how?


  3. wombat86
    Posted 3 years ago #

    Yes, I did get it to work after trying many different things.

    I added this around line 504 of wpuf-edit-post.php:

    do_action( 'wpuf_edit_post_after_update', $post_id );
    $permalink = get_permalink( $post_id );
    wp_redirect( $permalink );

    I hope that works for you!

  4. laupie
    Posted 3 years ago #

    Thanks! This works fine!

    Would be nice if there was a pluggable wpuf_after_edit_redirect or something, but for now my problem is solved! Thanks!

  5. rajun
    Posted 3 years ago #

    its working ... though "Post updated successfully" message not showing in updated page.

  6. mecanographik
    Posted 3 years ago #

    To keep the "success message" after the update, first add a get parameter to your url like :

    $permalink = get_permalink( $post_id ).'?pid=' . $post_id . '&mes=success';

    and than, just move the code near the line 76, where you have :

    $post_tags = wp_get_post_tags( $curpost->ID );

    and add this line :

    if (isset( $_GET['mes'] ) && ($_GET['mes']) == "success" ){
        		echo '<div class="success">' . __( 'Post updated succesfully.', 'wpuf' ) . ' <a href="'. get_permalink( $curpost->ID ).'"> View my post...</a></div>';

    it works fine for me

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP User Frontend
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic