WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/24/2018 10:58:22 PM (2 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.
Merges [42606] to the 4.9 branch.
Fixes #42697.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/options.php

    r41289 r42607  
    181181            require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
    182182
    183             $language = wp_download_language_pack( $_POST['WPLANG'] );
    184             if ( $language ) {
    185                 $_POST['WPLANG'] = $language;
     183            if ( wp_can_install_language_pack() ) {
     184                $language = wp_download_language_pack( $_POST['WPLANG'] );
     185                if ( $language ) {
     186                    $_POST['WPLANG'] = $language;
     187                }
    186188            }
    187189        }
Note: See TracChangeset for help on using the changeset viewer.