Support

Account

Home Forums Feedback ACF/save_post question Reply To: ACF/save_post question

  • Got it to work using this code here:

    function my_acf_load_field( $value, $post_id, $field  )
    {	
    	$event_start = get_field_object('field_5217ac66687dc', $post_id);
    	$event_end = get_field_object('field_524b4ca5ff418', $post_id);
        
    	if( empty( $event_end['value'] )):
    		$value = $event_start['value'];
    	endif;
    
    	return $value;
    }
    
    //add_filter('acf/update_value/key=field_524b4ca5ff418', 'my_acf_load_field', 10, 3);

    Problem is, if you save it duplicates it if empt, then if you clear it and hit save again, it is blank till you hit save a second time.