[wp-trac] [WordPress Trac] #17276: custom post type problems needs addressed

WordPress Trac wp-trac at lists.automattic.com
Sun May 1 03:56:43 UTC 2011


#17276: custom post type problems needs addressed
-------------------------+------------------------------
 Reporter:  squeeky      |       Owner:  squeeky
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Taxonomy     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+------------------------------

Comment (by squeeky):

 - on "automatically flush rewrite rules" :
 post types do not need to be stored persistently to alleviate the need to
 visit "Settings" > "Permalinks" after registering a new custom post type -
 I did a quick test - in wp-includes/post.php I inserted :

 {{{
 $wp_rewrite->flush_rules(false);
 }}}

 between line 1003 and line 1004 - so it now is :

 {{{
                 $wp_rewrite->add_permastruct($post_type,
 "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'],
 $args->permalink_epmask);
                 $wp_rewrite->flush_rules(false); // *inserted line
         }
 }}}

 i just did this now / without much thought / but that single line there
 now makes it so that there is no need to visit "Settings" > "Permalinks"
 after registering a new custom post type - i'm sure some of you who know
 wordpress inside-out could figure out an even better way to do this - and
 i SUSPECT something like for registering taxonomies might be good too (i
 don't know / i didn't test that yet)

 , , , , , , , , , , , , ,

 - RE "Custom Post Type support is lacking in general" :
 you state "there's no point in using custom post types if they behave just
 like normal posts" < very true - i know this, of course - BUT no matter
 how unique a custom post type is, chances are it will have certain aspects
 (and only "certain aspects") in common with built_in post types - and
 therefore can certainly utilize features already in place for such
 aspects...

 I will (by tomorrow) submit a working example for alterations to the
 default categories widget...

 where added handling for taxonomy of custom post types

 ONLY kicks in IF
 - FIRST > custom post types exist
 - AND SECOND > custom post types has taxonomy that is hierarchical

 ELSE
 widget remains in current default / and option to use for "custom post
 type categories" would not be present

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


More information about the wp-trac mailing list