mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 19:54:28 +00:00
Role/Capability: Introduce capabilities dedicated to installing and updating language files.
The new meta capabilities are called `install_languages` and `update_languages`. Prior to this change, there were no proper capability checks applied. Instead only the filesystem and related constants were checked, and for actual permissions a rather vague fallback was used where a user needed to have at least one of the other updating capabilities. In addition to being generally more verbose, the new capabilities make it possible for example to allow a user to update languages, but nothing else. By default they fall back to the original way of how they were handled. Props johnbillion, flixos90. Fixes #39677. git-svn-id: https://develop.svn.wordpress.org/trunk@41268 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -33,12 +33,15 @@ if ( ! is_multisite() || current_user_can( 'update_core' ) ) {
|
||||
}
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
if ( current_user_can( 'update_core' ) )
|
||||
if ( current_user_can( 'update_core' ) ) {
|
||||
$cap = 'update_core';
|
||||
elseif ( current_user_can( 'update_plugins' ) )
|
||||
} elseif ( current_user_can( 'update_plugins' ) ) {
|
||||
$cap = 'update_plugins';
|
||||
else
|
||||
} elseif ( current_user_can( 'update_themes' ) ) {
|
||||
$cap = 'update_themes';
|
||||
} else {
|
||||
$cap = 'update_languages';
|
||||
}
|
||||
$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), $cap, 'update-core.php');
|
||||
unset( $cap );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user