[wp-trac] [WordPress Trac] #9674: Better support for custom post types

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 9 19:01:44 UTC 2010


#9674: Better support for custom post types
------------------------------------+---------------------------------------
 Reporter:  wnorris                 |        Owner:  ryan    
     Type:  task (blessed)          |       Status:  reopened
 Priority:  normal                  |    Milestone:  3.0     
Component:  Administration          |      Version:  2.9     
 Severity:  normal                  |   Resolution:          
 Keywords:  has-patch tested early  |  
------------------------------------+---------------------------------------

Comment(by sirzooro):

 There is one important piece missing, as [comment:31 Denis-de-Bernardy
 pointed earlier]:
 > Following up on the previous remark...
 >
 > some kind of is_custom() function would be useful, and a means to bypass
 the WP query entirely in the workflow immediately after the query is
 parsed. else WP_Query may get loaded with junk.
 >
 > init_query_flags() for instance, probably also needs some reference to
 is_custom = false. after parse_query is done, $wp_query filters itself
 through do_action_ref_array(), and if it ends up with is_custom set to
 true at that stage, the actual WP query gets skipped entirely -- WP should
 then make the assumption that it has been set up already.
 >
 > I don't think we actually need anything in the template loader, since
 there is a hook in there already. But there definitely needs something
 over in the wp_query query class to go something like: please bail the WP
 query.

 I would like to see function with following declaration, in order to be
 able to check if current page belongs to given post type and/or give list
 of custom posts to test against:[[BR]]
 `function is_custom( $post_type = '', $post_id = '' )`

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9674#comment:284>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list