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


acf/load_field amend form title

    • jarvis

    • November 9, 2017 at 3:09 am

    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

    • James

    • January 3, 2018 at 7:24 am

    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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.