So, i successfully managed to add a drop down option, the problem is when i click save all of the options are removed, however the chosen option is implemented successfully.
Here is the relevant code:
function widget($args, $instance) {
extract( $args );
$pfxattribution = $instance['pfx-attribution'];
}
<p>
<label for="<?php echo $this->get_field_id('pfx-attribution'); ?>"><?php _e('Choose attribution:'); ?></label>
<select id="<?php echo $this->get_field_id('pfx-attribution'); ?>" name="<?php echo $this->get_field_name('pfx-attribution'); ?>" class="widefat" />
<option>Purefx</option>
<option>Foreign Exchange</option>
<option>Currency Exchange</option>
</select>
</p>
function update($new_instance, $old_instance) {
// Get the old values
$instance = $old_instance;
// Update with any new values (and sanitise input)
$instance['pfx-attribution'] = strip_tags( $new_instance['pfx-attribution'] );
return $instance;
}
Any help is greatly appreciated