Opened 10 years ago
Closed 10 years ago
#34151 closed enhancement (wontfix)
Auto save permalink after register post type / taxonomy
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Rewrite Rules | Keywords: | close |
Focuses: | Cc: |
Description
many times after register post type or change new post type settings (example: enabled archive with custom slug) or when register custom taxonomy I had 404 error when I wanted to go for post type / taxonomy archive. Save permalink fixed this problem that this is uncomfortable and not friendly.
Change History (4)
#3
@
10 years ago
Registering post types is usually done on init
. Flushing rewrite rules at the same time would generate unnecessary load on the server as it only needs to be done once.
That's why the docs recommend doing this on plugin activation.
#18450 and #29118 are probably the best approaches to this, so +1 to closing this ticket.
Note: See
TracTickets for help on using
tickets.
It is enough to just go to the permalink settings page to flush the rewrite rules. The fact that rewrite rules do not get automatically flushed is one of those thing in WordPress a developer currently just has to know. This is true for custom taxonomies and custom rewrite rules too.
To automatically flush the rewrite rules has been suggested several times. The most relevant ticket I found was #10446, from 6 years ago.
Personally, I don't see this a good enough reason to start storing CPT definitions (or their hashes or anything like that) in the database to be able to compare if they have been changed. That is why I suggest this issue to be closed.