Support

Account

Home Forums Backend Issues (wp-admin) Options select in Edit Posts Reply To: Options select in Edit Posts

  • 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.