I'd like to create a view that selects posts that do not have a row in the database for a specific custom field. Is this possible? I tried a filter that looks for a constant that is empty for the custom field, but it's not working ... I assume because the posts in question do not have that row in the database (wp_postmeta table). I'm attaching a screenshot of the query filter that is not working for this.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+01:00)
Hi there
You need the EXISTS test, but it's not possible to add that using the UI, you will need to use the API hook wpv_filter_query to modify the generated query to include such a condition.
The View you create is essentially a user-friendly UI for generating such queries, and so when modifying the generated queries using the Views API you will work with exactly the same query parameters.