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

Metabox not show in categories custom post type cmb2

Updated December 13, 2017 01:08 AM

Add Custom Taxonomy for Blog Meta Info

Updated February 08, 2018 14:08 PM

Tribe's Event Calender Filtering event based on City

Updated August 16, 2017 14:08 PM