Home › Forums › General Issues › Action to check if specific field value changed on post update? › Reply To: Action to check if specific field value changed on post update?
Thanks for your quick reply! Your example worked to compare the values, but the $old_value is returning an array rather than a single value. This is the output from print_r($field):
Array ( [key] => field_56607351f4d8b [label] => Delivery Method [name] => delivery_method [_name] => delivery_method [type] => text [order_no] => 1 [instructions] => [required] => 0 [id] => acf-field-delivery_method [class] => text [conditional_logic] => Array ( [status] => 0 [allorany] => all [rules] => 0 ) [default_value] => [allow_null] => 0 [multiple] => 0 [formatting] => html [maxlength] => [placeholder] => [prepend] => [append] => ) 1
I’m not sure the difference between [name] and [_name] but perhaps since they have the same value, that’s why I’m getting an array?
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.