[wp-trac] [WordPress Trac] #28401: Redundant condition in WP_Query::get_posts()

WordPress Trac noreply at wordpress.org
Thu May 29 17:54:01 UTC 2014


#28401: Redundant condition in WP_Query::get_posts()
----------------------------+-----------------------------
 Reporter:  SergeyBiryukov  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  low             |  Milestone:  Awaiting Review
Component:  Query           |    Version:  2.2
 Severity:  minor           |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 This condition in [source:tags/3.9.1/src/wp-includes/query.php#L2881
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28401>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list