0

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";}
0

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"; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.