[wp-trac] [WordPress Trac] #37645: Changes made to certain is_*() functions generates PHP Notices when arrays or objects are present

WordPress Trac noreply at wordpress.org
Wed Feb 8 18:44:04 UTC 2017


#37645: Changes made to certain is_*() functions generates PHP Notices when arrays
or objects are present
--------------------------+------------------------------
 Reporter:  Enchiridion   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by boonebgorges):

 @wonderboymusic Thanks. I agree that hydrated objects are fine, and the
 idea of a helper method for this sort of thing seems OK to me. I guess my
 point is that this specific use of `is_attachment()` is not semantically
 correct: `is_attachment()` means "the current query is for attachments"
 (ie `WP_Query( 'post_type=attachment' )`), and not "the current post is an
 attachment". For the latter, and in the case of `get_post_class()`,
 `'attachment' === $post->post_type` seems like it's what's actually
 intended.

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


More information about the wp-trac mailing list