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.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.