I have a bunch of posts where each post have one or more custom fields
each custom field can have one out of 15 names
I need an automatic way that can go through all these post and check the custom fields and then put that post into the correct categories on the site.
PostA has two custom fields, the values on each custom field is Yellow and Blue
PostB has one custom field, the value is Blue
PostC has four custom fields, the values are Blue, Yellow, Green and Red
When the script has gone through the posts the result should look like this:
Blue has 3 posts in it
Yellow has 2 posts in it
Green has 1 post in it
Red has 1 post in it
The post I want to process are in Draft mode.