Twin value tags as an esoteric taxonomy

I suspect the answer might be, get ready to write some SQL but I’m going to ask anyway.

I have a situation where I am pulling data from an outside source and storing it in a custom post type. For the main, this looks like it will work very well. However, there is a slight bump in the road.

The data comes with what are called stances. They exist as key-value pairs where key and value could be anything. Given that I store other data in the meta already, what I was hoping for was something like tags but in pairs. A taxonomy that works exactly like tags in most respects but has two values.

I toyed with converting the values into $tag = “{$key}|{$value}”; but I can see that getting messy and bloated really fast.

The current solution puts the entire array into a single meta. It works but it is not great for “select all posts of type X that agree foo is bar”.

Which brings me to ask if a more complex two-factor taxonomy is even possible?

Read more here:: Twin value tags as an esoteric taxonomy

Leave a Reply

Your email address will not be published. Required fields are marked *