How to create meta fields with more than 1 relation?

by Himad   Last Updated June 13, 2019 09:08 AM

I am creating a recruitment plugin. There's a custom post type called opening, and it has a metabox which displays a select field with a list of candidates(each option's value is the candidate's ID as a WP User).

Now, when the post is saved, the selected option of the field is added as a meta field of the post. The issue is that I need to know the ID of the candidate and the ID of the recruiter who assigned the candidate to the opening.

I tried adding the meta field as opening-candidate-{$candidateID}-recruiter, and assign the recruiterID as the row value, however, It doesn't feel right to insert dynamic named columns in the DB.


enter image description here

I'd appreciate any better ideas to handle this!

Related Questions

Updated June 29, 2018 17:08 PM

Updated December 13, 2017 01:08 AM

Updated February 08, 2018 14:08 PM

Updated June 05, 2015 23:03 PM

Updated August 16, 2017 14:08 PM