Make WordPress Core

Opened 6 years ago

Closed 11 months 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:


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

Change History (3)

#1 @dd32
6 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
6 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
11 months 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.