shortcode to create dynamic dropdown box form shortcode attributes
Based on your example at the bottom of your question, and your statement that you would like something like that for readability, I’d do something like this: function dropdown_option($atts) { $dropid = (isset($atts[‘dropid’])) ? $atts[‘dropid’] : ”; global $sco_array; if (!empty($atts[‘value’]) && !empty($atts[‘text’])) { $sco_array[$dropid][$atts[‘value’]] = $atts[‘text’]; } } add_shortcode(‘sco’,’dropdown_option’); function sc_dropdown($atts) { $id = … Read more