Browser: Brave
OS: macOS
I have been trying to set up a query to find a custom field of another post type where the value is equal to the author of this post type. For context, I have a ‘profile’ post type where a profile post is auto created when a user is created. That user creates posts using a ‘research’ post type. And on the ‘profile’ post type I wish to find the posts that the author contributed to. They are selected as the user in a custom field.
However, I have tried it this way:
(and tried using the mb_research_academicinterviewer_ID that Bricks generates)
I have also tried it in the query editor:
$contributor = get_the_author_meta('ID'); // And tried every variation, putting in {}, '{}', and using {author_meta:ID}. As a sidenote it is unclear to me how to use the Bricks way of mixing php and bricks - would prefer if regular php.
return [
'post_type' => 'research',
'post_status' => 'publish',
'meta_query' => [
[
'key' => 'academicinterviewer_ID', //and tried with mb_research_academicinterviewer_ID
'value' => $contributor,
'compare' => '='
],
],
'posts_per_page' => -1,
];
But both just give me a list of all the posts, without the query being added. I have checked of course that there is a value in academicinterviewer_ID. But cannot get this working - I either get all or nothing.
Could the issue be that I am trying to double query. So I am working on one custom post type with one author, and then trying to pull in other posts from different authors where a field equals the author of the original profile post type