Support

Account

Home Forums Backend Issues (wp-admin) Relationship field – get ACF field values from custom options page Reply To: Relationship field – get ACF field values from custom options page

  • The second example was all I needed! Thanks, it works now. Here’s what I ended up using:

    function acf_load_color_field_choices( $field ) {
    
        $field['choices'] = array();
        
        $choices = get_field( 'colour_repeater', 'option', false );
    
        if( have_rows( 'colour_repeater', 'options' ) ): while ( have_rows( 'colour_repeater', 'options' ) ) : the_row();
    
            $choice = get_sub_field( 'colour_name', 'options' );
            $field['choices'][$choice] = $choice;
    
        $i++; endwhile; endif;
    
        return $field;
    
    }
    
    add_filter( 'acf/load_field/name=colours', 'acf_load_color_field_choices' );