Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44951 closed enhancement (fixed)

Don't assign a variable inside an If statement in get_the_modified_author()

Reported by: promz's profile promz Owned by: pento's profile pento
Milestone: 5.1 Priority: normal
Severity: minor Version: 5.1
Component: Posts, Post Types Keywords: has-patch
Focuses: coding-standards Cc:

Description

In the wp-admin/author-template.php > get_the_modified_author() function, there is a $last_id variable being declared inside an if statement. It is not a good coding practice. One might think that there is a mistake of comparison operator.

Attachments (1)

author-template.php.patch (509 bytes) - added by promz 6 years ago.

Download all attachments as: .zip

Change History (7)

#1 @promz
6 years ago

  • Component changed from General to Administration
  • Keywords has-patch added; needs-patch removed
  • Severity changed from normal to minor

#2 @mukesh27
6 years ago

  • Component changed from Administration to Posts, Post Types
  • Summary changed from Dont assign a variable inside an If statement in get_the_modified_author() to Don't assign a variable inside an If statement in get_the_modified_author()

Hi @promz, Welcome to WordPress Trac! Thanks for the ticket.

Last edited 6 years ago by mukesh27 (previous) (diff)

#3 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 5.0
  • Owner set to SergeyBiryukov
  • Status changed from assigned to reviewing

#4 @peterwilsoncc
6 years ago

  • Milestone changed from 5.0 to 5.1

Moving to the 5.1 milestone due to the WordPress 5.0 focus on the new
editor (Gutenberg).

#5 @pento
6 years ago

  • Owner changed from SergeyBiryukov to pento
  • Status changed from reviewing to accepted

#6 @pento
6 years ago

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

In 44461:

Coding Standards: Improve the readability of get_the_modified_author().

Props promz.
Fixes #44951.

Note: See TracTickets for help on using tickets.