Home Forums Front-end Issues acf/load_field amend form title


acf/load_field amend form title

  • Hi All,

    I’m really hoping someone can help.

    I have a series of frontend forms. All of which use the post title in the form fields.

    However, on one particular form, I wish to change the wording from Title to Subject

    I know I could use something like:

    function my_acf_load_field( $field ) {
      $field['label'] = 'Your custom name';
      return $field;
    add_filter('acf/load_field/name=_post_title', 'my_acf_load_field');

    However, this alters ALL forms not just one.

    How can I target just one particular form please?

    Thanks in advanced

  • Hi @jarvis

    Thanks for the mail.

    You may consider adding the filter dynamically only when loading that specific form.

    If that form is only used on a specific template file or page, you could introduce check for the same inside the method before modifying it.

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘acf/load_field amend form title’ is closed to new replies.