Home › Forums › ACF PRO › Update post_meta with ACF date value › Reply To: Update post_meta with ACF date value
You need to create an acf/save_post filter https://www.advancedcustomfields.com/resources/acf-save_post/ something like this.
add_filter('acf/save_post', 'my_copy_date_filter', 20);
// priority is 20 so that it runs after acf has saved the value
function my_copy_date_filter($post_id) {
$post_type = get_post_type($post_id);
if ($post_type != 'eveniment') {
// not our post type, bail early
return;
}
$date = get_field('data_incepe', $post_id);
update_post_meta($post_id, 'calendar_data', $date);
}
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.