Changeset 55099 for trunk/src/wp-admin/user-edit.php
- Timestamp:
- 01/19/2023 02:11:08 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/user-edit.php
r55096 r55099 9 9 /** WordPress Administration Bootstrap */ 10 10 require_once __DIR__ . '/admin.php'; 11 12 /** WordPress Translation Installation API */ 13 require_once ABSPATH . 'wp-admin/includes/translation-install.php'; 11 14 12 15 wp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) ); … … 346 349 </tr> 347 350 348 <?php $languages = get_available_languages(); ?> 349 <?php if ( $languages ) : ?> 351 <?php 352 $languages = get_available_languages(); 353 $can_install_translations = current_user_can( 'install_languages' ) && wp_can_install_language_pack(); 354 ?> 355 <?php if ( $languages || $can_install_translations ) : ?> 350 356 <tr class="user-language-wrap"> 351 357 <th scope="row"> … … 365 371 wp_dropdown_languages( 366 372 array( 367 'name' => 'locale',368 'id' => 'locale',369 'selected' => $user_locale,370 'languages' => $languages,371 'show_available_translations' => false,372 'show_option_site_default' => true,373 'name' => 'locale', 374 'id' => 'locale', 375 'selected' => $user_locale, 376 'languages' => $languages, 377 'show_available_translations' => $can_install_translations, 378 'show_option_site_default' => true, 373 379 ) 374 380 ); … … 912 918 </script> 913 919 920 <script type="text/javascript"> 921 jQuery( function( $ ) { 922 var languageSelect = $( '#locale' ); 923 $( 'form' ).on( 'submit', function() { 924 // Don't show a spinner for English and installed languages, 925 // as there is nothing to download. 926 if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) { 927 $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' ); 928 } 929 }); 930 } ); 931 </script> 932 914 933 <?php if ( isset( $application_passwords_list_table ) ) : ?> 915 934 <script type="text/html" id="tmpl-new-application-password">
Note: See TracChangeset
for help on using the changeset viewer.