} $out = array(); if (!is_array($choices)) { $out[] = array('id' => $name . '_' . self::clean_str_for_field($choices), 'label' => $choices, 'value' => self::clean_str_for_field($choices)); } else { foreach ($choices as $choice) { if (!is_array($choice)) { $out[] = array('label' => $choice, 'id' => $name . '_' . self::clean_str_for_field($choice), 'value' => self::clean_str_for_field($choice)); } else { # if choice is already an array, we need to check for missing data if (!array_key_exists('id', $choice)) { $choice['id'] = $name . '_' . self::clean_str_for_field($choice['label']); } if (!array_key_exists('value', $choice)) { $choice['value'] = $name . '_' . self::clean_str_for_field($choice['label']); } $out[] = $choice; } } } return $out; } } # end class RO3 # require files for plugin foreach (RO3::$classes as $class) { RO3::req_file(ro3_dir("lib/class-{$class}.php")); } # load static variables for RO3 class RO3::$style = RO3_Options::$options['style']; RO3::$color = RO3_Options::$options['main_color'];