| @@ 149-152 (lines=4) @@ | ||
| 146 | $language = isset( $languages[ $parts[0] ] ) ? $parts[0] : 'en'; |
|
| 147 | ||
| 148 | // Print all the supported language, preselecting the one configured in WP (or English if not supported). |
|
| 149 | foreach ( $languages as $code => $label ) { ?> |
|
| 150 | <option |
|
| 151 | value="<?php esc_attr_e( $code ) ?>" <?php echo selected( $code, $language, FALSE ) ?>><?php esc_html_e( $label ) ?></option> |
|
| 152 | <?php } ?> |
|
| 153 | </select> |
|
| 154 | ||
| 155 | <div class="btn-wrapper"> |
|
| @@ 52-56 (lines=5) @@ | ||
| 49 | // If we support WP's configured language, then use that, otherwise use English by default. |
|
| 50 | $language = isset( $languages[ $params['value'] ] ) ? $params['value'] : 'en'; |
|
| 51 | ||
| 52 | foreach ( $languages as $code => $label ) { ?> |
|
| 53 | <option value="<?php echo esc_attr( $code ); ?>" |
|
| 54 | <?php echo selected( $code, $language, false ) ?>><?php |
|
| 55 | echo esc_html( $label ) ?></option> |
|
| 56 | <?php } ?> |
|
| 57 | </select> |
|
| 58 | <?php echo $description; ?> |
|
| 59 | ||