[wp-trac] [WordPress Trac] #24257: is_attachment() should accept $attachment parameter

WordPress Trac noreply at wordpress.org
Thu Jan 23 03:22:53 UTC 2014


#24257: is_attachment() should accept $attachment parameter
----------------------------------------+-----------------------------
 Reporter:  alex-ye                     |       Owner:  wonderboymusic
     Type:  enhancement                 |      Status:  reopened
 Priority:  normal                      |   Milestone:  3.9
Component:  Query                       |     Version:  3.5.1
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
----------------------------------------+-----------------------------
Changes (by nacin):

 * keywords:  has-patch => has-patch needs-unit-tests
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 I think this is solid. Could we add some assertions that also assert
 false? Just to make sure we don't have problems in the future. It might be
 nice to further assert things like $query->is_single/is_page/is_attachment
 (the property, not the methods), that the queried object matches the post
 that was created, etc.

 Additionally, note that attachments are also is_single except in a single
 situation where it is instead is_page. It would be good to test
 is_singular(), is_singular and the respective is_(post|page) (methods and
 properties) in both truthiness and falseness.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24257#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list