Opened 9 years ago
Closed 8 years ago
#34489 closed defect (bug) (duplicate)
WP oEmbed: The embed-template 404 condition isn't getting triggered for 404'd embeds
Reported by: | DrewAPicture | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Embeds | Keywords: | needs-patch has-screenshots 2nd-opinion close |
Focuses: | Cc: |
Description
When a post has been embedded and the permalinks have since been changed, an iframe with the 404 template for the embed site is displayed instead of triggering the 404 condition in embed-template.php.
Steps to reproduce:
- Create a post.
- Create a second post, embedding the first post.
- Change the site's permastruct to something else
- View the second post.
Expected: The 404 markup from embed-template.php
Actual: The general 404 markup for the the embed source site theme in an iframe.
Example post: http://wcpdx.trywpbeta.com/2015/10/testing-oembedding-of-posts/
Attachments (1)
Change History (12)
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
9 years ago
#3
@
9 years ago
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
9 years ago
#7
@
9 years ago
- Milestone changed from 4.4 to Future Release
Punting pending further consideration of a good solution.
It looks like this falls back to what #4328 describes: When the permalink structure changes, WordPress doesn't catch this and properly redirect to the new structure.
You have the same problem with any other rewrite endpoint, e.g. when accessing the post's comment feed under the old permalink structure.
Too late to fix that scenario in this cycle though. On the other hand, we could treat the embed endpoint as a special case, always setting
is_embed
to true when/embed/
is found in the request URL.I'm not really familiar with the rewrite component, so if anyone wants to help out, let me know.