Query related custom post type
-
Dear sir’s, I’m developing plugin with multiple custom post types where relationships between them are done through storing id’s of the other as meta fields;
event custom post type
instructor custom post type
attendee custom post typeattendee stores the meta ‘event-id’, while event stores the meta ‘instructor-id’
What I’m trying to express a join query that will filter the admin table for attendee based on instructor-id.
I’m triggering my ‘pre_get_posts’ filter function but I don’t know how to best build my $query->get(‘meta_query’) when $_GET[‘instructor-id’] is set.
Any help to get on how to set my ‘meta_query’ so I can filter based on instructor?
The topic ‘Query related custom post type’ is closed to new replies.