Make WordPress Core

Opened 7 years ago

Closed 2 years ago

#40979 closed defect (bug) (wontfix)

add_rewrite_endpoint() doesn't work when applied to unattached media

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Rewrite Rules Keywords: close
Focuses: Cc:

Description

add_rewrite_endpoint( 'foo', EP_ATTACHMENT ); doesn't seem to be working for unattached media items. For example visiting the following returns a 404:

example.com/attachment-slug/foo/

Change History (3)

#1 @dd32
7 years ago

  • Keywords close added

This makes sense to me as-is, although isn't what would be expected by some.

EP_ATTACHMENT applies to attachment rules only, these rules are for attached media only, ie. /2017/post-name/attachment-name/.
It does not apply to the page rules, which is how the unattached media is queried.

For reference, here's the rewrite rule hit:

url: /unattached-media/
regex: (.?.+?)(?:/([0-9]+))?/?$
query: pagename=unattached-media&page=

This is quite possibly a wontfix.

#2 @henry.wright
7 years ago

Agreed this makes sense as is if you consider unattached media to not be "attachments". I think the confusion arises because of the post_type.

#3 @JeffPaul
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I concur that this works "correctly" and that this can be closed. Reminder to others that you can still comment on closed issues as well as have them re-opened should more/better/different information become available.

Note: See TracTickets for help on using tickets.