Support

Account

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.