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?