Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site#36705
Merged
noisysocks merged 1 commit intotrunkfrom Nov 23, 2021
Merged
Conversation
…e=gutenberg-edit-site. This allows the JavaScript to work in Core where the URL will be site-editor.php.
23 tasks
|
Size Change: -15 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
kevin940726
approved these changes
Nov 22, 2021
Member
kevin940726
left a comment
There was a problem hiding this comment.
I would do it another way but this is fine too 😆 .
| // Navigate to the created template part editor. | ||
| window.location.search = addQueryArgs( '', { | ||
| page: 'gutenberg-edit-site', | ||
| window.location.href = addQueryArgs( window.location.href, { |
Member
There was a problem hiding this comment.
Would it be easier if we use window.location.pathname?
Suggested change
| window.location.href = addQueryArgs( window.location.href, { | |
| window.location.href = addQueryArgs( window.location.pathname, { |
Member
Author
There was a problem hiding this comment.
Most links in WP Admin use absolute, not relative, URLs, so I say let's do that. (Also I don't want to wait for CI again 😂.)
| href={ addQueryArgs( '', { | ||
| page: 'gutenberg-edit-site', | ||
| href={ addQueryArgs( window.location.href, { | ||
| postId: undefined, |
Member
There was a problem hiding this comment.
Having to reset postId and postType has probably the same amount of efforts as having to pass page=gutenberg-edit-site 😅 . In the future, we can hopefully abstract this away in #36488 so I don't think it matters either way.
Member
Author
There was a problem hiding this comment.
Yeah a router would be nice 😀
noisysocks
added a commit
that referenced
this pull request
Nov 23, 2021
…e=gutenberg-edit-site. (#36705) This allows the JavaScript to work in Core where the URL will be site-editor.php.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes https://github.com/WordPress/gutenberg/pull/36379/files#r753881439.
This allows the JavaScript to work in Core where the URL will be
site-editor.php, notthemes.php?page=gutenberg-edit-site.How has this been tested?
Checklist:
*.native.jsfiles for terms that need renaming or removal).