Opened 19 years ago
Closed 17 years ago
#5553 closed defect (bug) (fixed)
add_rewrite_endpoint does not work for attachments
| Reported by: | Curioso | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Permalinks | Version: | |
| Severity: | normal | Keywords: | needs-patch needs-testing |
| Cc: | Focuses: |
Description
The functionality for adding endpoints in rewrite rules does not work for attachments.
In wp-includes/rewrite.php:
//do endpoints for attachments
if ($endpoint) { foreach ($ep_query_append as $regex => $ep) {
if ($ep[0] & EP_ATTACHMENT) {
$rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2);
$rewrite[$sub2 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2);
}
} }
should be:
//do endpoints for attachments
if ($endpoints) { foreach ($ep_query_append as $regex => $ep) {
if ($ep[0] & EP_ATTACHMENT) {
$rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
$rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
}
} }
Note the typing error in $endpoints, and the '?' is already present in $subquery.
Attachments (1)
Change History (11)
#1
@
19 years ago
- Keywords needs-patch added
- Milestone 2.5 → 2.4
- Owner changed from to
- Status new → assigned
#2
@
19 years ago
- Summary add_rewrite_endpoint does not work → add_rewrite_endpoint does not work for attachments
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
created diff based on code in Description. untested.