Problem:
How to display all records where custom checkbox field is not checked.
Solution:
To fetch records where postmeta key is not exists, Please try to add following code to your current theme's functions.php file.
add_filter( 'wpv_filter_query', 'func_not_checked_posts', 10, 3 ); function func_not_checked_posts( $query_args, $view_settings, $view_id ) { if($view_id = 999999) { $query_args['meta_query'][] = array( 'key' => 'wpcf-interested', 'compare' => 'NOT EXISTS', ); } return $query_args; }
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 2 replies, has 2 voices.
Last updated by 7 years, 1 month ago.
Assisted by: Minesh.