[wp-trac] [WordPress Trac] #39164: WP 4.7 broke get_post_type or requires an explicit integer value?

WordPress Trac noreply at wordpress.org
Wed Dec 7 21:14:34 UTC 2016


#39164: WP 4.7 broke get_post_type or requires an explicit integer value?
--------------------------+-----------------------------
 Reporter:  ssuess        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I just upgraded to WP 4.7, and suddenly code that uses get_post_type($id)
 stopped returning anything, and didn't throw an error either.

 After trying a few things, I found that it would start working again if I
 changed my code from


 {{{
 get_post_type($id)
 }}}

 to


 {{{
 get_post_type(intval($id))
 }}}

 But I can't find anything in the docs about WP suddenly requiring explicit
 integer values. Anyone else seeing this?

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


More information about the wp-trac mailing list