I made a true/false ACF field called display_sorting
. It appears that it returns null
no matter if I set the default value or not.
<?php var_dump(get_field('display_sorting'));?>
returns :
[...].php:26:null
If I update the value from the page the field appears, the value will be correctly set to true
or false
.
<?php var_dump(get_field('display_sorting'));?>
will return this time :
[...].php:26:false
or
[...].php:26:true
My problem is that I would like to set the default value to true
(which is supposed to be the option I try here) so I don't have to set manually the value on x pages, but currently the default value isn't properly read.
Am I missing something ?