Dynamically fill a post custom field with post publish date
When you get the date with function get_the_date() you need to pass a $post object or ID as a second parameter: $date = get_the_date( $date_format, $post ); The first parameter here is the PHP date format. The second – Post ID or WP_Post object Here is an example that should work: add_action( ‘acf/save_post’, ‘my_acf_save_post’ ); … Read more