This will get you the choices array inside $field
variable:
$choices = $field[ 'choices' ];
From there, you can iterate with either a while or foreach loop depending on what you are trying to do with the array.
EDIT: rereading your question, you specify what you are trying to do! Sorry for skipping that part!
echo '<ul>';
foreach($choices as $key => $choice):
echo '<li>' . $key . ' and ' . $choice . '</li>';
endforeach;
echo '</ul>';
Should produce:
- orange_county and Orange County
- los-angeles and Los Angeles
This should not be considered complete code. Escape your output for security’s sake. Just illustrating a concept here.
Related Posts:
- Order by & include array by specific post ids
- Get list of all registered post types slugs
- Limit the post for differents custom post type in the same wp_query
- array_pop() expects array, boolean given for $event_type_term ->slug
- Save custom post type in different table
- Automatically adding meta data to posts or multiple query help
- Create a post in custom post type using field in registration form after users submit form
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Save an array from drop-down in custom meta box
- Get parse_query filter to return slug instead of id
- How to store multiple values in 1 meta_key with radio input?
- Display a CPT based on a metabox selection
- Display post content with respect to its title?
- Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
- Limit the post for differents custom post type in the same wp_query
- Custom Post Types — $args vs. labels array
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- Add first letter of titles to array, then compare arrays
- Query Custom Post Types with checkboxes
- Create Array from custom post type to display a slider
- Inefficient Query Confusion
- Querying multiple values from a single key
- Check if user has comment on current post
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How do I disply an array inside a custom post type?
- Getting custom post types to properly display alphabetically
- How can I loop at a Specific Taxonomy from a custom post type?
- Update value inside array update_post_meta
- Custom archive page for custom taxonomy and pagination issue
- Get an array of the number of post per year of a custom post type (WordPress)
- Query when is one or several values
- Create Post Types from a XML url (Real Estate website)
- Staggering featured post using ‘sticky’
- If custom taxonomy exist on post?
- Convert Custom Post Data to Javascript Array for Autocomplete
- Trying to get custom post type attachment images to function in indexed array
- CPT and metabox: create multi checkbox by using array?
- getting a blank login page :( any way I can fix this without having to do a clean install?
- Pulling in Related Posts based on Post Type array
- WordPress custom field images not getting inserted into array
- Meta-Box to add multiple items one at a time and on publish save all
- Custom Post Type Author Array Problem
- taxonomy terms array not working
- Display custom posts in checkbox list
- posting twice from an array?
- create functions based on array values
- How to create a job post by email parsing? [closed]
- Display custom post type attached media file sizes
- post__in select all custom posts and not the selected array of ids
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- register_post_type sort order by title by default
- Custom post types – Use post_id in permalink structure
- Rewrite custom post type rss feed links
- Populate Taxonomy from Custom Posts
- Show related posts on single page by custom taxonomy on custom post
- Same base slug for CPT post and CPT taxonomy terms
- how to make custom posts sticky? [duplicate]
- Custom Post Type, Two categories, Two columns with Pagination
- Custom Post Type slug same as page name causing a conflict
- Why is my custom loop not filtering correctly nor paginating?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Separate comment section for post type in dashboard
- GravityForm: Populate Dropdown with custom post type [closed]
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Role capability delete multiple post type posts doesn’t work
- Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”
- I need to add endpoint for wordpress categories
- Meta Query Not Returning Output Despite Having Matching Values
- Using taxonomy term in CPT permalink – Pages 404’s
- Custom Post Type Archive URL is wrong
- How to use custom template files in deeper directory?
- Use “archive” as slug for custom post type
- Warning: Invalid argument supplied for foreach() [closed]
- Author posts not appearing for custom post type
- How to concatenate two separate colums into one?
- Why content coming from single?
- What would be a proper name for a custom post type created for static content?
- Get taxonomy term by slug in post on archive page
- Displaying custom fields for custom post type generate with Custom Post Type UI Plugin
- get_post_meta returns NULL in front-end, but correct result in back-end
- Ideas to connect external database table to wordpress posts as custom field source
- CPT structure questions
- All in one calendar custom post type query doesnt work as expected
- Navigate by Tags inside a custom Post Type
- add_filter get array data before display in custom post_type
- WordPress Custom Post Loop
- programmatically generated custom post type is created more than once
- Button link display in shortcodes using custom field in ACF
- Peepso: Add extra data field (custom post meta) to postbox
- Create posts inside CPT post
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Taxonomy to Post Type. Every Taxonomy Item can be Producer or Developer
- do action inside a class is not working
- Create an additional template page for every term taxonomy
- Custom Post Type Not Displaying Correctly
- Query Distinct Taxonomies of Custom Post Type
- Excerpt for each post type and for is_front_page
- strange conditional tag behaviour [duplicate]
- Comments are not working on Custom Post Type
- Tracking Total Pageviews By Post Type In Google Analytics