WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
Redirect after editing post (6 posts)

  1. wombat86
    Member
    Posted 1 year 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!

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. laupie
    Member
    Posted 1 year 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?

    Thanks!

  3. wombat86
    Member
    Posted 1 year 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 );
    exit;

    I hope that works for you!

  4. laupie
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  6. mecanographik
    Member
    Posted 1 year ago #

    Hi,
    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

About this Topic

Tags