Support

Account

Home Forums ACF PRO Target a particular form in a page

Solving

Target a particular form in a page

  • Hi, How do I target a particular fields in a particular form? Currently this field is in my Edit Profile form. I have a Sign Up form that has the same input field. I want to make the field not required only on that Edit Profile form. Below is what I have, I did some digging and I found using is_page() would work but when I go to my sign up form the field is missing.

    add_filter(‘acf/load_field/name=employers_name’, ‘my_acf_load_employers_name’);
    function my_acf_load_employers_name( $field ) {

    if( is_page(‘edit-profile’) ) {
    // make required
    $field[‘required’] = false;
    // return
    return $field;
    }
    }

Viewing 1 post (of 1 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.