I am trying an IF statement to check if the user has actually selected a value in the ACF DatePicker but this doesn't validate correctly. Any ideas?
$fxdate = get_field('fl_date');
if (isset($fxdate)) {echo "set";} else {echo "not set";}
I am trying an IF statement to check if the user has actually selected a value in the ACF DatePicker but this doesn't validate correctly. Any ideas?
$fxdate = get_field('fl_date');
if (isset($fxdate)) {echo "set";} else {echo "not set";}
Please check if echoing $fxdate is working.
$fxdate = get_field('fl_date');
In ACF simply below code works,
if($fxdate){ echo "set"; } else { echo "not set"; }