Make WordPress Core


Ignore:
Timestamp:
01/24/2018 10:41:58 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Role/Capability: Make install_languages capability check less restrictive.

A user should still be able to have the capability, even when language packs cannot be automatically installed. The automatic installation part is separate from that now.

Props flixos90.
Fixes #42697.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-new.php

    r42343 r42606  
    7474        } elseif ( in_array( $_POST['WPLANG'], get_available_languages() ) ) {
    7575            $meta['WPLANG'] = $_POST['WPLANG'];
    76         } elseif ( current_user_can( 'install_languages' ) ) {
     76        } elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
    7777            $language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
    7878            if ( $language ) {
     
    260260                            'languages'                   => $languages,
    261261                            'translations'                => $translations,
    262                             'show_available_translations' => current_user_can( 'install_languages' ),
     262                            'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
    263263                        )
    264264                    );
Note: See TracChangeset for help on using the changeset viewer.