Support

Account

Home Forums ACF PRO ACF – Taxonomy Select List Reply To: ACF – Taxonomy Select List

  • Hello @pixeldesignsuk

    Am I correct in thinking that you are in fact looking for “Terms” of a “Taxonomy” and not actually the “Taxonomies” of a CPT?

    If you are looking for “Taxonomy Terms” (as opposed to Taxonomies) which makes more sense if looking for the “slug”, then you could try this:

    
    $field['choices'] = array();
    $terms = get_terms( array(
      'taxonomy' => 'custom_taxonomy_name',
      'hide_empty' => false,
    ));
    
    if ( $terms ) {
      foreach ( $terms as $term ) {
        $choices[$term->slug] = $term->slug . ' : ' . $term->name;
      }
    }
    

    Reference: