Support

Account

Forum Replies Created

  • If the checkbox is not checked, there is no value, but also no key saved. So the whole custom field does not exist in the database.

    What you should do with true/false or checkboxes is to check if the value of field exists in the database.

    You can easily do this by using the “EXISTS” and “NOT EXISTS” compare operators.

    
    'meta_query'    => array(
        array(
            'key'	  	=> 'people_hide_on_archive',
            'value'	  	=> 'true',
            'compare' 	=> 'NOT EXISTS',
        ),
    )
    

    Hope this helps you.

Viewing 1 post (of 1 total)