#26974 closed defect (bug) (duplicate)
WP confuses post permalink and day permalink when using /%year%/%monthnum%/%postname%/
| Reported by: | Denis-de-Bernardy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Permalinks | Version: | 1.5 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
To reproduce, create a new blog, select that permalink structure, and publish an untitled post. View it. Expected: the post shows up. Actual: the day shows up empty — unless, of course, the post's day matches the post's id.
Minor, but annoying. Temporary fix to disable day links entirely:
add_filter('date_rewrite_rules', function($date_rewrite_rules) {
if (get_option('permalink_structure') == '/%year%/%monthnum%/%postname%/') {
$date_rewrite_rules = array_filter($date_rewrite_rules, function($rule) {
return strpos($rule, '&day=') === false;
});
}
return $date_rewrite_rules;
});
Methinks disabling day links should be the default behavior in WP when that structure is chosen.
Change History (2)
#1
@
12 years ago
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
- Version trunk → 1.5
This ticket was mentioned in IRC in #wordpress-dev by ddebernardy. View the logs.
12 years ago
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #5305 and #22592.