Home › Forums › Backend Issues (wp-admin) › Custom fields get emptied when publishing › Reply To: Custom fields get emptied when publishing
save_post() works fine in 4.1.8, and doesn’t create any errors. Here’s XDebug Context for ACF 4.1.8 , breakpoint at $f = apply_filters('acf/load_field', false, $k );
in acf.php:save_post( $post_id )
Inside the loop, 1st iteration (single date and time picker field):
$f = array[18]
$f['name'] = (string) dato
$f['class'] = (string) date_time_picker
$f['time_format'] = (string) H:mm
$f['field_group'] = (int) 6583
$f['conditional_logic'] = array[3]
$f['conditional_logic']['allorany'] = (string) all
$f['conditional_logic']['rules'] = array[1]
$f['conditional_logic']['rules'][0] = array[2]
$f['conditional_logic']['rules'][0]['operator'] = (string) ==
$f['conditional_logic']['rules'][0]['field'] = (string) null
$f['conditional_logic']['status'] = (int) 0
$f['show_week_number'] = (string) false
$f['value'] = <string>
$f['required'] = (int) 0
$f['type'] = (string) date_time_picker
$f['id'] = (string) acf-field-dato
$f['key'] = (string) field_51d520b7091da
$f['label'] = (string) dato
$f['picker'] = (string) slider
$f['show_date'] = (string) true
$f['order_no'] = (int) 0
$f['instructions'] = <string>
$f['save_as_timestamp'] = (string) true
$f['date_format'] = (string) m/d/y
$v = (string) 7/11/13 7:00
$post_id = (int) 6640
$k = (string) field_51d520b7091da
$this = Acf[1]
$this->settings = array[5]
$this->settings['path'] = (string) /Users/per/Sites/dev.local/wp-content/plugins/advanced-custom-fields/
$this->settings['dir'] = (string) http://dev.local/wp-content/plugins/advanced-custom-fields/
$this->settings['upgrade_version'] = (string) 3.4.1
$this->settings['hook'] = (string) advanced-custom-fields/acf.php
$this->settings['version'] = (string) 4.1.8
Second iteration, date and timepicker field inside a repeater field
$f = array[16]
$f['name'] = (string) repeat
$f['class'] = (string) repeater
$f['field_group'] = (int) 6583
$f['conditional_logic'] = array[3]
$f['conditional_logic']['allorany'] = (string) all
$f['conditional_logic']['rules'] = array[1]
$f['conditional_logic']['rules'][0] = array[3]
$f['conditional_logic']['rules'][0]['operator'] = (string) ==
$f['conditional_logic']['rules'][0]['field'] = (string) null
$f['conditional_logic']['rules'][0]['value'] = <string>
$f['conditional_logic']['status'] = (int) 0
$f['layout'] = (string) table
$f['row_min'] = (int) 0
$f['button_label'] = (string) Add Row
$f['sub_fields'] = array[1]
$f['sub_fields'][0] = array[18]
$f['sub_fields'][0]['label'] = (string) dato2
$f['sub_fields'][0]['name'] = (string) dato2
$f['sub_fields'][0]['value'] = <string>
$f['sub_fields'][0]['key'] = (string) field_51da7b24dbf9a
$f['sub_fields'][0]['instructions'] = <string>
$f['sub_fields'][0]['save_as_timestamp'] = (string) true
$f['sub_fields'][0]['column_width'] = <string>
$f['sub_fields'][0]['order_no'] = (int) 0
$f['sub_fields'][0]['id'] = (string) acf-field-dato2
$f['sub_fields'][0]['picker'] = (string) slider
$f['sub_fields'][0]['class'] = (string) date_time_picker
$f['sub_fields'][0]['time_format'] = (string) h:mm tt
$f['sub_fields'][0]['type'] = (string) date_time_picker
$f['sub_fields'][0]['show_week_number'] = (string) false
$f['sub_fields'][0]['show_date'] = (string) true
$f['sub_fields'][0]['required'] = (int) 0
$f['sub_fields'][0]['date_format'] = (string) m/d/y
$f['sub_fields'][0]['conditional_logic'] = array[3]
$f['sub_fields'][0]['conditional_logic']['status'] = (int) 0
$f['sub_fields'][0]['conditional_logic']['rules'] = (int) 0
$f['sub_fields'][0]['conditional_logic']['allorany'] = (string) all
$f['required'] = (int) 0
$f['type'] = (string) repeater
$f['id'] = (string) acf-field-repeat
$f['key'] = (string) field_51da7b12dbf99
$f['label'] = (string) repeat
$f['order_no'] = (int) 1
$f['instructions'] = <string>
$f['row_limit'] = <string>
$v = array[2]
$v['acfcloneindex'] = array[1]
$v['acfcloneindex']['field_51da7b24dbf9a'] = <string>
$v[1373458984969] = array[1]
$v[1373458984969]['field_51da7b24dbf9a'] = (string) 7/12/13 12:00 am
$post_id = (int) 6640
$k = (string) field_51da7b12dbf99
$this = Acf[1]
$this->settings = array[5]
$this->settings['path'] = (string) /Users/per/Sites/dev.local/wp-content/plugins/advanced-custom-fields/
$this->settings['dir'] = (string) http://dev.local/wp-content/plugins/advanced-custom-fields/
$this->settings['upgrade_version'] = (string) 3.4.1
$this->settings['hook'] = (string) advanced-custom-fields/acf.php
$this->settings['version'] = (string) 4.1.8
But I guess this is not really the issue. As said previously, the content exist in post meta but it’s not displayed/populated to the custom field.
When I open a post, where (in ACF) is data read from post meta (ie, where should I set my breakpoints)?
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!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.