| @@ -14,11 +14,9 @@ | ||
| 14 | 14 | |
| 15 | 15 | $wp_admin_bar->add_menu( array( |
| 16 | 16 | 'parent' => 'top-secondary', |
| 17 | 17 | 'id' => 'bogo-user-locale', |
| 18 | - 'title' => sprintf( | |
| 19 | - '<span class="ab-icon"></span><span class="ab-label">%s</span>', | |
| 20 | - esc_html( $current_language ) ) ) ); | |
| 18 | + 'title' => '✔ ' . $current_language ) ); | |
| 21 | 19 | |
| 22 | 20 | $available_languages = bogo_available_languages( array( |
| 23 | 21 | 'exclude' => array( $current_locale ), |
| 24 | 22 | 'exclude_enus_if_inactive' => true, |
| @@ -43,21 +41,17 @@ | ||
| 43 | 41 | |
| 44 | 42 | add_action( 'admin_init', 'bogo_switch_user_locale' ); |
| 45 | 43 | |
| 46 | 44 | function bogo_switch_user_locale() { |
| 47 | - if ( empty( $_REQUEST['action'] ) | |
| 48 | - || 'bogo-switch-locale' != $_REQUEST['action'] ) { | |
| 45 | + if ( empty( $_REQUEST['action'] ) || 'bogo-switch-locale' != $_REQUEST['action'] ) | |
| 49 | 46 | return; |
| 50 | - } | |
| 51 | 47 | |
| 52 | 48 | check_admin_referer( 'bogo-switch-locale' ); |
| 53 | 49 | |
| 54 | 50 | $locale = isset( $_REQUEST['locale'] ) ? $_REQUEST['locale'] : ''; |
| 55 | 51 | |
| 56 | - if ( ! bogo_is_available_locale( $locale ) | |
| 57 | - || $locale == bogo_get_user_locale() ) { | |
| 52 | + if ( ! bogo_is_available_locale( $locale ) || $locale == bogo_get_user_locale() ) | |
| 58 | 53 | return; |
| 59 | - } | |
| 60 | 54 | |
| 61 | 55 | update_user_option( get_current_user_id(), 'locale', $locale, true ); |
| 62 | 56 | |
| 63 | 57 | if ( ! empty( $_REQUEST['redirect_to'] ) ) { |