[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:08:25 UTC 2011
#17325: No good way to flush rules on registering post types
--------------------------+-----------------------------
Reporter: WraithKenny | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Permalinks | Version: 3.1
Severity: normal | Keywords:
--------------------------+-----------------------------
Plugins that register post types can't `flush_rewrite_rules()` on
activation.
flush_rewrite_rules is too early (for post types registered at `init`) at
`do_action( 'activate_' . $plugin, $network_wide );` and adding a delayed
action on `init` fails because shortly after `activate_plugin()` there's a
`wp_redirect()` at http://core.trac.wordpress.org/browser/trunk/wp-
admin/plugins.php#L61 (which sets a new code execution) before the `init`
hook runs.
What's left is manually visiting `options-permalinks.php`, setting an
option and checking to do the flush, or flushing every page load, as is
being recommended on many blogs.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17325>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list