Hook not working as wanted
-
Hi, I have ninja forms post on a frontend with a edit button, when clicked it takes the user to admin area, once the data is updated, wordpress bring the user back to the edit action page But i want them to go to my custom page.
i have used “save_post” hook which works fine but the new form submission does not work. may be because its firing on new form save action as well.
so i tried edit_post hook which redirect the page but it does not perform the post data update, it simple redirects to the page i want to go without any update on the edit form of wp backend.
what hook i can use so that it will only trigger when the post is updated and then it will redirect to a new page
function my_project_updated( $post_id ) { // If this is just a revision, don't send the email. $urlto = "https://wpengine.com/post-list/"; wp_redirect( $urlto ); exit; } add_action( 'edit_post', 'my_project_updated' );
above code redirect but does not update the post content.
I want this hook to fire only when the user is updating an old post and it should not trigger when the user create a new post.
- The topic ‘Hook not working as wanted’ is closed to new replies.