Support

Account

Home Forums General Issues acf/save_post not working with calculated update_field Reply To: acf/save_post not working with calculated update_field

  • Is the first option a more manual version of the second one, I didn’t quite follow where you were going with it.

    As for the second one, it is very close to what I had, but with some better checks and using acf_get_fields, instead of get_fields. What is the reasoning behind this, won’t get fields work just as well?

    I have 4 acf groups and I include them in acf_form from the beginning:

    
    /* Create Front-End Form */ 
    global $current_user; //get current logged in user info
    $author_id = $current_user->ID; //pull user id and assign to author_id variable
    					
    //form/post options
    $args = array( 
    'post_id'	=> 	'new_post', //creates new post instead of editing 																										
    'field_groups' 	=>	array(79,359,1877,1966), //proposal field group
    'return'        =>	'%post_url%', // redirect to new post url
    'new_post'	=> 	array( //option for new post
        'post_type'	=> 	'proposals', //creates a new post in "Proposals" CPT
        'post_status'	=> 	'draft', //
        'post_author'	=>	$author_id //assigns author as the person logged in
    			),
    'submit_value'	=> 'Create Proposal'
    );
    							
    //loads the ACF fields with above settings
    acf_form( $args ); 
    

    I tried the second option, but I got the same outcome. All of the fields populate on creation except for the calculations, since they can’t get the values for the other fields.