Opened 11 years ago
Closed 11 years ago
#28401 closed defect (bug) (fixed)
Redundant condition in WP_Query::get_posts()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | low |
Severity: | minor | Version: | 2.2 |
Component: | Query | Keywords: | has-patch |
Focuses: | Cc: |
Description
This condition in WP_Query::get_posts() appears to be redundant:
if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search || !$this->is_singular ) )
Unless I'm missing something, it could be simplified to:
if ( $this->is_comment_feed && ! $this->is_singular )
Introduced in [4934]. The change doesn't affect any of the current unit tests.
Attachments (2)
Change History (5)
#2
@
11 years ago
- Keywords has-patch added; needs-patch removed
(get-posts-redundant-condition.28401.diff: forgot to commit syntax change before diffing, get-posts-redundant-condition.28401-2.diff is the right diff)
I agree, this is a redundant check. is_archive
and is_search
can only be true if is_singular
is false. Checking for ! is_singular
is enough.
Note: See
TracTickets for help on using
tickets.
Syntax fix