If you have a situation where you have a post creation page and a post editing page, you can use code to redirect from the creation page to the editing page after the post has been created.
<?php add_action( 'af/form/submission', function ( $form, $fields, $args ) { // Check if this is the correct form. If not, stop here. if ( $form['key'] !== '{YOUR_FORM_KEY}' ) { return; } // Get the ID of the post that was just created $post_id = AF()->submission['post']; if ( $post_id ) { // Build the edit page URL (replace '/your-edit-page/' with your actual edit page path) $redirect_url = add_query_arg( 'post', $post_id, home_url( '/your-edit-page/' ) ); // Redirect the user wp_redirect( $redirect_url ); exit; } }, 20, 3 );
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article