-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Site Logo: Update url for site icon settings with fallback for WP core versions earlier than 6.5 #59485
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
Site Logo: Update url for site icon settings with fallback for WP core versions earlier than 6.5 #59485
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -268,6 +268,14 @@ const SiteLogo = ( { | |
| </ResizableBox> | ||
| ); | ||
|
|
||
| // Support the previous location for the Site Icon settings. To be removed | ||
| // when the required WP core version for Gutenberg is >= 6.5.0. | ||
| const shouldUseNewUrl = ! window?.__experimentalUseCustomizerSiteLogoUrl; | ||
|
|
||
| const siteIconSettingsUrl = shouldUseNewUrl | ||
| ? siteUrl + '/wp-admin/options-general.php' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shame there's no id we can use as a hash value. The other options have them and are used in core, e.g.,
Which reminds me that Gutenberg should probably be using admin_url() or
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Great point — that could be a good thing to look into for 6.6, since folks should be able to filter admin urls and have it propagate to links in Gutenberg 👍 |
||
| : siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline'; | ||
|
|
||
| const syncSiteIconHelpText = createInterpolateElement( | ||
| __( | ||
| 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.' | ||
|
|
@@ -276,10 +284,7 @@ const SiteLogo = ( { | |
| a: ( | ||
| // eslint-disable-next-line jsx-a11y/anchor-has-content | ||
| <a | ||
| href={ | ||
| siteUrl + | ||
| '/wp-admin/customize.php?autofocus[section]=title_tagline' | ||
| } | ||
| href={ siteIconSettingsUrl } | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this could have a better home in
compat/6.5?It's related to compatibility, and also it would be deleted as a matter of course when Gutenberg supports 6.5 and above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a good point, stuff in
lib/experimentaldoesn't get audited for removal when we update the lowest supported WP.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. My main thinking in keeping it under
lib/experimentalwas thatcompat/6.5typically houses things that are intended to be backported, and it's probably a good thing for all thewindow.__experimental*globals to be co-located.That said, I'm happy to move it around. Did you have a particular file in mind? It looks like most of the current ones are there to match files in
wordpress-develop🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, we have a
compat/wordpress-6.5/compat.phpfile — I reckon that might be a good home, I can move it there 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally it would be a new
compat/wordpress-6.5/editor-settings.phpfile, because none of the existing files are related in any way 😅I see compat folders as the place we put things we'll want to remove when we no longer support that version. It's not always stuff that's to be/has been backported, but anything that is version-specific. Really it's mostly for the sake of easier cleanup later!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to add a new file, e.g., lib/compat/wordpress-6.4/theme-previews.php
Also maybe with a comment to say that it doesn't need backporting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compat.phpalready has this heading* WordPress 6.5 compatibility functions., so I think that might be a good home for now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the discussion, folks! I've moved the location over in b8d9ae2
Let me know if you'd like any further changes! 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested. LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!