the date is output in edit form - 7505 : ../../../../wordpress_docker/volumes/wp_volume/wp-content/plugins/divi-form-builder/includes/modules/FormField/FormField.php * -> 845 : ../../../../wordpress_docker/volumes/wp_volume/wp-content/plugins/divi-form-builder/includes/DiviFormBuilder.php * */ function process_form_acf_dates($form_id, $post_array) { $acf_field_start = 'acf_date_hidden_for_'; $acf_date_fields = \FBPATCH\array_has_keys_starting_with($acf_field_start, $post_array); if (empty($acf_date_fields)) { return; } foreach ($acf_date_fields as $field) { $acf_date = $post_array[$field]; $acf_field = substr($field, strlen($acf_field_start)); $new_date_text = $post_array['meta_input'][$acf_field]; $acf_key = $post_array['meta_input']['_'.$acf_field]; \FBPATCH\add_date_to_acf_object_class($acf_key, $acf_date); Fbpatch::update_acf_date($post_array['ID'], $acf_key, $acf_date); } } add_action('df_before_insert_post', __NAMESPACE__.'\process_form_acf_dates', 10, 2); /* * to update a field object (so, globally) * using `acf_update_field` * -> 980 : ../../../../wordpress_docker/volumes/wp_volume/wp-content/plugins/advanced-custom-fields/includes/acf-field-functions.php * */ function add_date_to_acf_object_class($acf_id) { $field = get_field_object($acf_id); $field_class = $field['wrapper']['class']; $field_classes = explode(' ', $field_class); $class = Fbpatch::ACF_DATE_CLASS; $field_classes = array_filter($field_classes, function($value) { $class = Fbpatch::ACF_DATE_CLASS; if (strpos($value, $class) !== 0) { return $value; } }); $field_classes[] = $class; $implode_class = implode(' ', $field_classes); $field['wrapper']['class'] = $implode_class; acf_update_field($field); } /* * here i use it to check if there are hidden field for acf dates * */ function array_has_keys_starting_with($needle, &$haystack) { $keys = array(); foreach ($haystack as $key => $value) { if (strpos($key, $needle) === 0) { $keys[] = $key; } } return $keys; } ?>