Skip to content

Commit 7da6cd1

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@62086 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0710e06 commit 7da6cd1

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/wp-admin/includes/ms.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,7 @@ function _access_denied_splash() {
614614
* @return bool True if the user has proper permissions, false if they do not.
615615
*/
616616
function check_import_new_users( $permission ) {
617-
if ( ! current_user_can( 'manage_network_users' ) ) {
618-
return false;
619-
}
620-
621-
return true;
617+
return current_user_can( 'manage_network_users' );
622618
}
623619
// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
624620

0 commit comments

Comments
 (0)