Function is generating select field, what can I do to set 'selected' currently saved value ... if possible? For example, previously I selected 36 and saved "update_option('_nos',$myvalue)"
function woo_add_spin() {
woocommerce_wp_select(
array(
'id' => '_select_nf',
'label' => __( 'Select #spins: ', 'woocommerce' ),
'selected' => true,
'options' => array(
'24' => __( '24', 'woocommerce' ),
'36' => __( '36', 'woocommerce' ),
'48' => __( '48', 'woocommerce' )
)
)
);
}
so every time function is executed i would like to check current value and set "selected" to the option with the same value or using jQuery check currently set value and just add 'selected' accordingly ?