Home › Forums › Front-end Issues › ACF redirect after the publication of a new page › Reply To: ACF redirect after the publication of a new page
Hi @buylov
Maybe you can try this code?
function my_pre_save_post( $post_id ) {
// check if this is to be a new post
$GLOBALS['acf_form']['return'] = add_query_arg( array(
'vc_action' => 'vc_inline',
'post_id' => $post_id,
'post_type' => 'page',
), 'http://mysite.com/wp-admin/post.php');
// return the new ID
return $post_id;
}
add_filter('acf/pre_save_post' , 'my_pre_save_post', 10, 1 );
Please take a look at this thread to learn more about it: http://support.advancedcustomfields.com/forums/topic/pass-new-post_id-to-url-or/.
Hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.