Support

Account

Home Forums Backend Issues (wp-admin) Filtering choices using load_field but not while editing field group

Helping

Filtering choices using load_field but not while editing field group

  • I want to filter choices in fields when using a field group, but not when editing field groups. I end up with site specific values being saved into field groups that I want to be able to export and use on other sites.

    Thanks,

  • what filter are you using to filter the values?

    In most cases adding this to the top of your filter will work

    
    global $post;
    if (is_a($post, 'WP_Post') && in_array(get_post_type($post), array('acf-field', 'acf-field-group'))) {
      // acf post types
      // return whatever value is being filtered
      return $original_value;
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.