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

1 Answer 1

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"; }
1
  • this doesn't work for me Commented Jun 30, 2018 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.