Changeset 47516
- Timestamp:
- 03/27/2020 09:56:24 PM (5 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r47219 r47516 113 113 } 114 114 115 if ( isset( $_POST['locale'] ) ) { 116 $locale = sanitize_text_field( $_POST['locale'] ); 117 if ( 'site-default' === $locale ) { 118 $locale = ''; 119 } elseif ( '' === $locale ) { 120 $locale = 'en_US'; 121 } elseif ( ! in_array( $locale, get_available_languages(), true ) ) { 122 $locale = ''; 123 } 124 125 $user->locale = $locale; 126 } 127 115 128 if ( $update ) { 116 129 $user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' === $_POST['rich_editing'] ? 'false' : 'true'; … … 119 132 $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false'; 120 133 $user->locale = ''; 121 122 if ( isset( $_POST['locale'] ) ) {123 $locale = sanitize_text_field( $_POST['locale'] );124 if ( 'site-default' === $locale ) {125 $locale = '';126 } elseif ( '' === $locale ) {127 $locale = 'en_US';128 } elseif ( ! in_array( $locale, get_available_languages(), true ) ) {129 $locale = '';130 }131 132 $user->locale = $locale;133 }134 134 } 135 135 -
trunk/src/wp-admin/user-new.php
r47218 r47516 499 499 <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td> 500 500 </tr> 501 <?php 502 $languages = get_available_languages(); 503 if ( $languages ) : ?> 504 <tr class="form-field user-language-wrap"> 505 <th scope="row"> 506 <label for="locale"> 507 <?php /* translators: The user language selection field label */ ?> 508 <?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span> 509 </label> 510 </th> 511 <td> 512 <?php 513 wp_dropdown_languages( array( 514 'name' => 'locale', 515 'id' => 'locale', 516 'selected' => 'site-default', 517 'languages' => $languages, 518 'show_available_translations' => false, 519 'show_option_site_default' => true, 520 ) ); 521 ?> 522 </td> 523 </tr> 524 <?php 525 endif; 526 ?> 501 527 <tr class="form-field form-required user-pass1-wrap"> 502 528 <th scope="row">
Note: See TracChangeset
for help on using the changeset viewer.