[wp-trac] [WordPress Trac] #14761: unregister_post_type()
WordPress Trac
wp-trac at lists.automattic.com
Fri Jul 8 18:29:55 UTC 2011
#14761: unregister_post_type()
-------------------------------------+-----------------------------
Reporter: nacin | Owner:
Type: enhancement | Status: new
Priority: lowest | Milestone: Future Release
Component: Post Types | Version: 2.9
Severity: normal | Resolution:
Keywords: needs-patch 2nd-opinion |
-------------------------------------+-----------------------------
Comment (by andy):
Deregistration would also be handy for plugins that are deactivating.
Typically you register post types on init. Some time after that, you get
the deactivation action. A responsible plugin would remove its rewrite
rules by flushing. However, it can't undo the registration, so the flush
doesn't remove the plugin's rewrites.
The hacky workaround I've used is to just delete the rewrite_rules option
on deactivation. They will be generated again when they are needed, so the
only noticeable effect is that the next site view may take a bit longer.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14761#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list