[wp-trac] [WordPress Trac] #39164: WP 4.7 broke get_post_type or requires an explicit integer value?
WordPress Trac
noreply at wordpress.org
Thu Dec 8 02:06:51 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 | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by ssuess):
UPDATE
So, using trim instead of intval works too.
{{{
get_post_type(trim($id))
}}}
And checking $id
{{{
(preg_match('/\s/',$id))
}}}
shows that it had a space. But oddly, this worked just fine in WP 4.6, so
something must have changed to make that less forgiving in WP 4.7
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39164#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list