To modify a field's placeholder when rendering an ACF form, you may use the af/field/before_render filter. This filter provides an opportunity to modify the field array before a form is rendered.
add_filter( 'af/field/before_render', function ( $field, $form, $args ) { // If we need to run this only on a specific form, check for the form key. if ( $form['key'] !== 'YOUR_FORM_KEY_HERE' ) { return $field; } // Set the placeholder on a specific field. if ( $field['name'] === 'email' ) { $field['placeholder'] = 'Enter your email address'; } return $field; }, 10, 3 );
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article