mirror of
https://github.com/WordPress/WordPress.git
synced 2026-06-19 07:37:07 +00:00
Code Quality: Simplify user permission check for importing new users.
This removes a redundant conditional in the `check_import_new_users()` function, simplifying its logic to directly return the result of the permission check. Follow-up to [https://mu.trac.wordpress.org/changeset/1829 mu:1829], [39945]. Props Soean. See #64238. Built from https://develop.svn.wordpress.org/trunk@62086 git-svn-id: http://core.svn.wordpress.org/trunk@61368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -614,11 +614,7 @@ function _access_denied_splash() {
|
||||
* @return bool True if the user has proper permissions, false if they do not.
|
||||
*/
|
||||
function check_import_new_users( $permission ) {
|
||||
if ( ! current_user_can( 'manage_network_users' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return current_user_can( 'manage_network_users' );
|
||||
}
|
||||
// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '7.0-beta6-62085';
|
||||
$wp_version = '7.0-beta6-62086';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user