-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site Logo: Add option to set site icon from Site Logo block (#35892)
* Add toggle for syncing site icon to site logo * Sync icon when first uploading logo, if no icon exists * Do not clear the site icon when toggling off syncing, instead restore to original icon * Link to Customizer from Site Logo syncing help text * Sync site icon on uploading new image or resetting image * Simplify logic * Automatically sync icon if none exists and adding logo for the first time * Add translated string for site icon property * Link directly to Site Icon settings in Customizer * Adjust copy * Correct opening customizer in new tab * Persist toggle state in an attribute * Turn the toggle off if the logo and icon fall out of sync If a user syncs the logo and icon via the toggle and saves changes, but later changes the site icon in the Customizer, we want the toggle to be reset to the `off` position when they next edit the block. * Discard unsaved changes to logo and icon when removing last Logo block * Prevent uncontrolled input when sync attribute undefined * Tighten up copy * Force syncing on initial selection * Get up-to-date logoBlockCount when removing block Previously we were getting the logoBlockCount on block creation, but this value could become out of date if more Site Logo blocks were added afterward. Now we count the number of blocks at the time of block removal, so that it is guaranteed up-to-date, and we ensure that changes are only discarded if there are no other Site Logo blocks on the page. * Add shouldSyncIcon attr to core blocks documentation
- Loading branch information
Showing
5 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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