Support Forum
Support › MB Relationships › WP_Query Multiple Relationships relation = AND doesn't work ?Resolved
Hi,
since yesterday I tried to make a WP_Query with 2 relationship with a AND relation.
Here is the content of the array of my query.
Array
(
[post_type] => recipe
[paged] => 1
[posts_per_page] => 9
[relationship] => Array
(
[0] => Array
(
[id] => recipes_to_brands
[to] => 75
)
[1] => Array
(
[id] => cheeses_to_recipes
[from] => 73
)
[relation] => AND
)
)
With that, no result.
If I exclude one of the two relation, I have my result.
So with
Array
(
[post_type] => recipe
[paged] => 1
[posts_per_page] => 9
[relationship] => Array
(
[0] => Array
(
[id] => recipes_to_brands
[to] => 75
)
[relation] => AND
)
)
And
Array
(
[post_type] => recipe
[paged] => 1
[posts_per_page] => 9
[relationship] => Array
(
[0] => Array
(
[id] => cheeses_to_recipes
[from] => 73
)
[relation] => AND
)
)
I have each time the same post found.
If I replace AND by OR, my result is found but I don't want to use an OR 😉
Wordpress Core, Metabox and Meta Box Aio are on last version.
Hi,
I will check this case and let you know later.
Thank you.
Hello,
thanks,
I did a video record with a quick sample test code.
https://www.youtube.com/watch?v=0gqSSPWWUZ4
https://gist.github.com/harkor/23a53e40a53908d6de98d505241cc6a8
Thank you
Hello,
have you been able to look at this ?
Sorry to insist but it's a little bit problematic for me.
Hi,
1 month since my last answer.
Any news ?
Hi,
I've added this case to the backlog development, I will get back to you if I have any information.
Hi, we have this exact same problem.
Do you have an update regarding this issue?
Hi !
I have the same problem.
Works well with OR but not with AND
Can you look into it when you have more time ?
Thanks !
I discover this issue since 18 february and still any fix...
Why is so long ?
Hi friends,
We are working tirelessly on this issue. Please check the commits in the repository https://github.com/wpmetabox/mb-relationships/commits/master