#18594 closed defect (bug) (invalid)
Permalinks should be saved twice on post_type slug change
Reported by: | Gecka | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.2.1 |
Component: | Permalinks | Keywords: | close |
Focuses: | Cc: |
Description
Hello,
In a plugin I allow my users to set the slug of a custom post type from a sttings page. I flush the rules on every load of that settings page (only that page)
When they change the slug, they have to save and then reload the settings page for the permlink to be correctly chnaged.... A single flush_rules call shouldn't be enought?
Change History (6)
#1
@
13 years ago
- Summary changed from Përmalinks should be saved twice on post_type slug change to Permalinks should be saved twice on post_type slug change
#4
@
13 years ago
- Keywords close added
- Severity changed from critical to normal
It sounds like the problem is that you're flushing the rewrite rules but with the old custom post type information still registered. The fix would be to re-register your post type after updating the option, e.g.
update_option( 'my_post_type_slug', $slug ); my_post_registration(); // calls register_post_type(), usually hooked into init flush_rewrite_rules();
I think there must be another ticket somewhere about this on Trac, but I couldn't find it just now.
Note: See
TracTickets for help on using
tickets.
Related #18040 ?