Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iframed editor: Fix relative wp-content URLs #66751

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function Iframe( {
<html>
<head>
<meta charset="utf-8">
<base href="${ window.location.origin }">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work, regardless of how the site is configured (top level, sub folder, ...) and also for third-party block editors?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't matter for relative urls starting with /, they should always use the root.
But for relative urls that don't start with a slash it's trickier. We'd have always use the current post URL etc. This wouldn't work without an iframe either (in the admin), so not sure if it's worth fixing.

<script>window.frameElement._load()</script>
<style>
html{
Expand Down
Loading