I created a function to save custom fields on publish a post. Something like this.
function create_fields() {
global $post;
$casa_id = $post->ID;
update_post_meta($post->ID, 'casa_id', $casa_id);
}
add_action('publish_post', 'create_fields');
This function saves on a custom field some string.
Now the question:
How can i use this action on older posts? I have 1000 posts and i don’t want to refresh all the posts manually, is this possible?
you can do something like this:
It worked. I tryed this:
For anyone who comes across this, the best solution that I found was this tool: https://github.com/mcguffin/acf-quick-edit-fields
This saved me an hour or two of manually updating 181 posts. After installing that plugin, I edited the ACF field and checked off the option âAllow editing this field in Bulk edit modeâ then I was able to bulk edit the posts and update the field.