I have dropdown which generates list of countries in wordpress plugin.
By default it selects first country, i want to change it to poland
What should i do?
if( !get_user_meta( get_current_user_id(), 'user_nationality', true ) ) {
$countries_obj = new WC_Countries();
$countries = $countries_obj->__get('countries');
$fields['billing']['user_nationality'] = array(
'type' => 'select',
'label' => __( 'Nationality', 'mangopay' ),
'options' => $countries,
'required' => true,
);
}
it' my own woocomerce related plugin, i am a beginner.
i followed this as well https://codex.wordpress.org/Creating_Options_Pages.