Opened 16 years ago
Closed 14 years ago
#16786 closed defect (bug) (worksforme)
Setting permalinks programatically breaks custom post type URL's
| Reported by: | gilbitron | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Rewrite Rules | Version: | 3.1 |
| Severity: | minor | Keywords: | 2nd-opinion reporter-feedback |
| Cc: | Focuses: |
Description
Using a function to programatically set permalinks (see attached) breaks custom post type URL's. A 404 page is displayed instead.
Visiting the Permalinks settings page fixes the issue (you don't even need to save the permalinks settings).
It turns out that you need to call $wp_rewrite->flush_rules() on the following page load for it to work, even though this is called at the end of the modify_permalinks() function.
Possibly related to #16736
Attachments (1)
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
It's important when you're calling modify_permalinks() as well.