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:
Sergey Biryukov
2026-03-20 22:36:59 +00:00
parent 25eaaa60d2
commit 41188387f9
2 changed files with 2 additions and 6 deletions
+1 -5
View File
@@ -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.
+1 -1
View File
@@ -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.