WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
[resolved] Submit a new post doesn't direct to the added post! (6 posts)

  1. Hope
    Member
    Posted 6 months ago #

    Hi dears,

    Adding a new post used to direct to the added post page. Now it just refresh the "add post" page but after adding the post.

    What could the problem be?

    Thanks
    Hope

    https://wordpress.org/plugins/wp-user-frontend/

  2. Hope
    Member
    Posted 6 months ago #

    Solved...

  3. usmanarfani
    Member
    Posted 6 months ago #

    Can you tell me how you solved it because i couldn't

  4. usmanarfani
    Member
    Posted 6 months ago #

    ok i have done it too but i will not leave others blank or questioning so here is the code i used to achieve this task
    add this code to yours theme's functions.php file

    add_filter('wpuf_after_post_redirect', 'some_callback');
    function some_callback(){
    wp_redirect(get_permalink($page_id)."?post=successful");
    }

    Put your post id in it to where you you want it to redirect when post is submitted successfully

  5. Hope
    Member
    Posted 6 months ago #

    Actually I didn't post the solution because what I did was modifying a plugin file which is not recommended since you will be forced to redo this modification on each update! But I did it, I needed a quick solution.

    What I did is a little modification on the wpuf-add-post.php file, in the end of the submit_post() function:
    instead of wp_redirect( $redirect );
    just put
    wp_redirect( get_permalink( $post_id ) );

    Regards
    Hope

  6. lilp1976
    Member
    Posted 4 months ago #

    Hi @usmanarfani, I found this did just the trick but require something similar for the Edit page, i.e. to redirect to the newly edited post (and include the success message). Any help greatly appreciated. Thanks
    R

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.