Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Mark current language option as selected in the admin. Ref #38
Browse files Browse the repository at this point in the history
  • Loading branch information
straube committed Feb 1, 2019
1 parent 6feaa22 commit fca0411
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions multiple-domain/MultipleDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MultipleDomain
* @var string
* @since 0.3
*/
const VERSION = '0.8.5';
const VERSION = '0.8.6';

/**
* The plugin instance.
Expand Down Expand Up @@ -652,7 +652,8 @@ private function getLangField($count, $lang = null)
. '<option value="">' . __('None', 'multiple-domain') . '</option>'
. '<option value="" disabled="disabled">--</option>';
foreach ($locales as $code => $name) {
$field .= '<option value="' . $code . '">' . $name . '</option>';
$selected = $lang === $code ? 'selected' : '';
$field .= '<option value="' . esc_attr($code) . '" ' . $selected . '>' . $name . '</option>';
}
$field .= '</select>';

Expand Down

0 comments on commit fca0411

Please sign in to comment.