Tell us what you are trying to do?
I am trying to create a view that will return all CPTs that do not have a checkbox checked. I am not storing 0 to the database.
Is there any documentation that you are following?
https://toolset.com/documentation/legacy-features/views-plugin/checking-fields-and-other-elements-for-emptynon-empty-values/
I followed the above and left the constant empty. The view did not return any CPTs including the ones with no checkbox checked.
Is there a similar example that we can see?
What is the link to your site?
rvrally.net
Hello,
You can use shortcode [types field="my-checkbox"][/types] to get your custom checkbox field value, and use it in wpv-conditional shortcode as condition, for example:
[wpv-conditional if="( '[types field="my-checkbox"][/types]' eq '' )"]The checkbox field "my-checkbox" is empty[/wpv-conditional]
More help:
https://toolset.com/documentation/legacy-features/views-plugin/using-shortcodes-in-conditions/
Luo,
Judging by the link, this is a legacy feature for the old views plug in. I am running the new views and do not see any way to insert the shortcode above. I assume that I need to run the legacy views plug in? If so, can I run both on the same site?
Luo,
OK. I figured out how to use the old views plug-in in my new Blocks environment. I have set up the filter in the old views plug in to this:
[wpv-filter-start hide="false"]
[wpv-filter-controls][wpv-conditional if="( '[types field="my-checkbox"][/types]' eq '' )"]The checkbox field "my-checkbox" is empty[/wpv-conditional][/wpv-filter-controls]
[wpv-filter-end]
The last issue - how do I find the "my-checkbox" name?
When you create the custom field, there is an option "Field slug", you can use it in Types shortcode, see my screenshot.
More help:
https://toolset.com/course-lesson/creating-custom-fields/