Custom Post Type Field Array parsing [closed]

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.

tech