[wp-trac] [WordPress Trac] #20647: get_post_type() returns nothing on custom post type archive pages with custom query and no results
WordPress Trac
wp-trac at lists.automattic.com
Wed May 9 22:37:42 UTC 2012
#20647: get_post_type() returns nothing on custom post type archive pages with
custom query and no results
-----------------------------+------------------------------
Reporter: MikevHoenselaar | Owner: MikevHoenselaar
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Post Types | Version: 3.3.2
Severity: normal | Resolution: invalid
Keywords: needs-patch |
-----------------------------+------------------------------
Comment (by scribu):
Here's what the docs say:
{{{
/**
* Retrieve the post type of the current post or of a given post.
*
* @since 2.1.0
*
* @uses $post The Loop current post global
*
* @param mixed $the_post Optional. Post object or post ID.
* @return bool|string post type or false on failure.
*/
function get_post_type( $the_post = false ) {
}}}
You should think of it as belonging to the same family as
get_post_status() and get_the_title().
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20647#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list