A form which has always previously rendered and functioned correctly has suddenly stopped working, probably due to a recent upgrade to ACF. I am passing specific fields in the acf_form arguments as follows:
'fields'=>array(
'first_name'
,'last_name'
,'date_of_birth'
,'tshirt_size'
)
These fields have suddenly stopped rendering. I’ve traced the code through the live plugin and compared it to my local copy and there’s a difference which appears to be the cause.
Line 1370 of api-template.php reads as follows:
$fields[] = get_field_object( $selector, $post_id, false, false );
whereas the equivalent line in my older version reads as:
$fields[] = acf_get_field( $selector );
If I omit the fields argument then the form renders correctly, but there’s an admin-only field that we don’t want to be displaying to front-end users.
I have tried replacing this line on my live site and the form appears to be restored correctly.
Obviously that’s not going to survive a further update to ACF, so what should I have done; or is this a mistake in the latest code?