Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#34151 closed enhancement (wontfix)

Auto save permalink after register post type / taxonomy

Reported by: sebastian.pisula Owned by:
Priority: normal Milestone:
Component: Rewrite Rules Version:
Severity: normal Keywords: close
Cc: Focuses:

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)

#1 @akibjorklund
11 years ago

  • Keywords close added

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.

#2 @SergeyBiryukov
11 years ago

  • Component GeneralRewrite Rules

There's some discussion on auto-flushing rewrite rules in #18450 and #29118.

#3 @swissspidy
11 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.

#4 @DrewAPicture
11 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

See comment:3.

Note: See TracTickets for help on using tickets.