[wp-trac] [WordPress Trac] #12588: Add function to check if current page is a custom post type
WordPress Trac
wp-trac at lists.automattic.com
Mon May 3 21:45:58 UTC 2010
#12588: Add function to check if current page is a custom post type
----------------------------+-----------------------------------------------
Reporter: sirzooro | Owner: nacin
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 3.0
Component: Administration | Version: 3.0
Severity: normal | Resolution:
Keywords: needs-patch |
----------------------------+-----------------------------------------------
Changes (by scribu):
* keywords: has-patch => needs-patch
* status: closed => reopened
* resolution: fixed =>
Comment:
is_post_type() doesn't work when trying to "Checks if a post type is
registered":
{{{
function _debug() {
var_dump(is_post_type('post'), (bool) get_post_type_object('post'));
}
add_action('init', '_debug', 100);
}}}
You get bool(false) bool(true).
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12588#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list