mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@42606 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -439,15 +439,7 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
break;
|
||||
case 'install_languages':
|
||||
case 'update_languages':
|
||||
if ( ! function_exists( 'request_filesystem_credentials' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'wp_can_install_language_pack' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
||||
}
|
||||
|
||||
if ( ! wp_can_install_language_pack() ) {
|
||||
if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
|
||||
Reference in New Issue
Block a user