Open
Description
Hi,
First, thank you for this plugin.
My goal is to handle a global canadian website and an individual website for each canadian provinces in French and English. The problem I encounter is it's not possible to register the link between differents pages for websites they have the same locale (the field name is the same: msls_input_en_CA).
I used an documented action to generate the provinces list in the administration, but I didn't see an existing hook which can solve my problem:
add_action( 'msls_admin_language_section', 'my_msls_admin_language_section', 10, 2 );
function my_msls_admin_language_section( $page, $section ) {
add_settings_field( 'provinces', __( 'Provinces' ), 'my_provinces', $page, $section );
}
function my_provinces() {
$options = array(
'ab' => 'Alberta',
'bc' => 'British Columbia',
'pe' => 'Prince Edward Island',
'mb' => 'Manitoba',
'nb' => 'New Brunswick',
'ns' => 'Nova Scotia',
'on' => 'Ontario',
'qc' => 'Quebec',
'sk' => 'Saskatchewan',
'nl' => 'Newfoundland and Labrador',
'nu' => 'Nunavut',
'nt' => 'Northwest Territories',
'yt' => 'Yukon'
);
$select = '<select id="provinces" name="msls[provinces]">';
$select .= '<option></option>';
foreach($options as $key => $option) {
$selected = '';
if(MslsOptions::instance()->provinces == $key) {
$selected = 'selected="selected"';
}
$select .= '<option value="' . $key . '" ' . $selected . '>' . $option . '</option>';
}
$select .= '</select>';
echo $select;
}
Did I miss a simple solution that could solve my problem?
Thanks.