How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
Assuming you have an array $locations available, you can use this code to generate a dropdown in the customizer. It’s not that different from a single value. $section_name=”wpse213980_section_name”; // adapt to your naming system $section_title=”wpse213980_section_title”; // adapt to your naming system $setting_name=”wpse213980_setting_name”; // adapt to your naming system $setting_field_type=”select”; $setting_field_options = $locations; $sanitize_callback = ‘sanitize_text_field’; … Read more