I just changed a crucial aspect of my theme, and posts tagged with a particular taxonomy called position
are now handled by a custom meta field called cmb_position_name
.
Posts that have the taxonomy
position
with the termevent_highlights
should now have acmb_position_event_highlights
meta value ofon
.Posts that have the taxonomy
position
with the termfeatured_news
should now have acmb_position_featured_news
meta value ofon
.Posts that have the taxonomy
position
with the termslider
should now have acmb_position_slider
meta value ofon
.
I need to make a script that migrates existing posts, adding these meta values accordingly.
What is a good place to put this script so that it is executed once, and ensures all the posts are migrated properly?