Hi @QueenEve
You can remove the if
statement surrounding the the_field function, ACF api will be available within this action.
It is most likely that ACF doesn’t haeva value for the field ‘test_field’, or ACF doesn’t know which post to load from.
You can do some testing like so:
<?php
echo '<pre>';
print_r(get_the_ID());
echo '</pre>';
echo '<pre>';
print_r(get_field('test_field'));
echo '</pre>';
die; ?>
Please report the output
Thanks
E