WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#35511 closed defect (bug) (fixed)

Remove even more unused local variables

Reported by: Latz Owned by: rachelbaker
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.4
Component: Comments Keywords: has-patch
Focuses: Cc:

Description

There are several local variables in "comment-template.php" which aren't used anymore.

Attachments (1)

35511.diff (1.7 KB) - added by Latz 4 years ago.

Download all attachments as: .zip

Change History (8)

@Latz
4 years ago

#1 @Latz
4 years ago

  • Keywords has-patch added

#2 @rachelbaker
4 years ago

  • Owner set to rachelbaker
  • Status changed from new to reviewing

#3 @rachelbaker
4 years ago

In 36343:

Comments: Remove unused $default_comments_page variable in get_comment_link().

Left in r34735, fetches the default_comments_page option twice since this variable is unused.

See #34073 and #35511.

Props Latz.

#4 @rachelbaker
4 years ago

  • Milestone changed from Awaiting Review to 4.5

#5 @rachelbaker
4 years ago

@Latz The comments_template() function is tricky because the variables set may be used in your theme's comments.php file. Example: I can see $comment_author_url used in theme-compat/comments.php.

Before any of the globals or local variables are removed from comments_template() some research and testing will need to be done across the theme directory.

#6 @Latz
4 years ago

Replying to rachelbaker:

The comments_template() function is tricky because the variables set may be used in your theme's comments.php file. Example: I can see $comment_author_url used in theme-compat/comments.php.

I have to admit that I hadn't thought that far. Will take a look but it at first sight it seems like a strange programming style.

Last edited 4 years ago by Latz (previous) (diff)

#7 @rachelbaker
4 years ago

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

Closing this since the unused variable that can be cleaned up at this time was done in r36343. @Latz feel free to open a new ticket as needed.

Note: See TracTickets for help on using tickets.