Meta Box
Support Forum
Support › General › Checkbox Values
Hello,
Is there a way to change the value of the checkbox to a boolean? Instead of '0' or '1', get a true or false?
Thanks.
Hi,
The meta value is saved in the database as a string. "True" or "false" is not as good as "0" or "1" when saving data. Besides, you still can use if ( get_post_meta( get_the_ID(), 'checkbox', true ) ) without any problem.
if ( get_post_meta( get_the_ID(), 'checkbox', true ) )
Alright, got it.