Say I've got the custom post type foo
with a meta box called bar
. I've posted an entry with bar
= pineapple
. Now I want to check if there is a foo
in the database with a bar
set to pineapple
. How would I do that?
I've managed to get this working using a wpdb
query but that doesn't feel right. Is there an elegant, maybe built-in way for me to do this?
bar
and it's meta value ispineapple
?