Fix: Export theme settings now include blog name and description options#307
Open
RachelRVasquez wants to merge 2 commits into
Open
Fix: Export theme settings now include blog name and description options#307RachelRVasquez wants to merge 2 commits into
RachelRVasquez wants to merge 2 commits into
Conversation
… in export, site icon was already there and logo is part of the theme_mods
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the theme settings export so it also includes the site’s title and tagline, which are stored in WordPress as options (blogname, blogdescription) rather than theme mods.
Changes:
- Add
blognameandblogdescriptionto the default$option_keyslist exported viaget_option().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
All Submissions:
Changes proposed in this Pull Request:
Fixed: Site Title (blogname) and Site Tagline (blogdescription) were missing because WordPress stores them as options, not theme mods — added both to
$option_keysso they're now exported viaget_option().The site logo and site icon won't export/import by just passing the options from one environment to another due to attachment IDs/paths being different. This would have to be a separate feature if it's something we want to pursue. For now, I'm removing site icon from the export functionality so it doesn't work anyway.
ℹ️ I also noticed if I used the block versions, for example, the site logo and added a logo when the setting in Customizer was empty, it properly updates the Customizer setting for it. As far as I understand, the blocks for Site Title, Site Tagline and Site Logo either use the same option name or sync so that regardless of whether it's set from Customizer or the block, it'll be included in our export.
How to test the changes in this Pull Request:
theme_modswere properly imported.Other information:
Changelog entry