[wp-trac] [WordPress Trac] #17325: No good way to flush rules on registering post types

WordPress Trac wp-trac at lists.automattic.com
Wed May 4 20:29:40 UTC 2011


#17325: No good way to flush rules on registering post types
--------------------------+-------------------------
 Reporter:  WraithKenny   |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Permalinks    |     Version:  3.1
 Severity:  normal        |  Resolution:  worksforme
 Keywords:                |
--------------------------+-------------------------
Changes (by scribu):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Here's how I do it:

 {{{
 function my_cpt_init() {
   register_post_type( ... );
 }
 add_action('init', 'my_cpt_init');

 function my_rewrite_flush() {
   my_cpt_init();
   flush_rewrite_rules();
 }
 register_activation_hook(__FILE__, 'my_rewrite_flush');
 }}}

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


More information about the wp-trac mailing list