Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#51619 closed defect (bug) (fixed)

Undefined $current_role variable in wp-admin/user-new.php

Reported by: ravipatel's profile ravipatel Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.6
Component: Users Keywords: has-patch
Focuses: coding-standards Cc:

Description

Undefined variable $current_role. Applied clean code

Attachments (1)

51619-user-new.php.patch (689 bytes) - added by ravipatel 4 years ago.
Removed undefine variable and manage clean code

Download all attachments as: .zip

Change History (3)

@ravipatel
4 years ago

Removed undefine variable and manage clean code

#1 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing
  • Summary changed from Coding standard : Undefined varible to Undefined $current_role variable in wp-admin/user-new.php

Hi there, thanks for the patch!

This appears to be a remnant of a variable that was used up to WordPress 2.6.x, when the Add New User form was still in the wp-admin/users.php file, as seen in lines 268, 278, 442 here.

Since the form was moved into a new file in [9614], the variable appears to be unused.

The instances remaining in wp-admin/users.php were removed in [28296], so this one can be removed too.

#2 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49298:

Coding Standards: Remove unused $current_role variable from Add New User form.

Follow-up to [9614], [28296].

Props ravipatel.
Fixes #51619.

Note: See TracTickets for help on using tickets.