Support

Account

Forum Replies Created

  • Yes that worked, seems obvious now. Thank you.

  • The Field key got it working. Thank you for your help!!

  • I’m not familiar with field keys or where to find them. Should the key be for disclosure_select (select field on the post) or disclosure_picker (options repeater)?

  • Thanks for your reply but I’m not understanding all the variable connections. I’ve created a new field group called “Post Fields” with a select field called “disclosure_select” that’s assigned to show on post type “post”. It does, it’s empty. I have my options group called “Post Disclosures” with a repeater field called disclosure_picker. And in my functions.php I have”

    // ACF load disclosure fields
    function acf_load_disclosures( $field ) {
    // reset choices
    $field[‘choices’] = array();
    // if has rows
    if( have_rows(‘disclosure_picker’, ‘option’) ) {

    // while has rows
    while( have_rows(‘disclosure_picker’, ‘option’) ) {
    // instantiate row
    the_row();
    // vars
    $value = get_sub_field(‘value’);
    $label = get_sub_field(‘label’);
    // append to choices
    $field[‘choices’][ $value ] = $label;
    }
    }
    // return the field
    return $field;
    }
    add_filter(‘acf/load_field/name=disclosure_select’, ‘acf_load_disclosures’);

    I’m sorry if it seems I’m doing something obviously stupid here.

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