Skip to content

Add an option to configure the site icon in general settings#6064

Closed
aaronjorbin wants to merge 34 commits intoWordPress:trunkfrom
aaronjorbin:trac/54370
Closed

Add an option to configure the site icon in general settings#6064
aaronjorbin wants to merge 34 commits intoWordPress:trunkfrom
aaronjorbin:trac/54370

Conversation

@aaronjorbin
Copy link
Member

Trac ticket: https://core.trac.wordpress.org/ticket/54370

This largely brings back code that was removed in https://core.trac.wordpress.org/changeset/33329 but it keeps everything on the same page rather than having a second flow just for site icon. This comes at the cost of no-js mode so the option is hidden from no-js users.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

github-actions bot commented Feb 7, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jorbin, audrasjb, mukesh27, joedolson, afercia, kebbet, swissspidy.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I left two questions :)

aaronjorbin and others added 3 commits February 8, 2024 11:17
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
id="js-remove-site-icon"
<?php echo has_site_icon() ? 'class="button"' : 'class="button hidden"'; ?>
>
<?php _e( 'Remove Site Icon' ); ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Make casing consistent. I think 'site icon' should probably be lowercased in all instances, matching the 'Change site icon' text.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sentence cased, technically.

<?php if ( has_site_icon() ) : ?>
<?php _e( 'Change site icon' ); ?>
<?php else : ?>
<?php _e( 'Choose a Site Icon' ); ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Make casing consistent

@aaronjorbin
Copy link
Member Author

@joedolson Thanks for the review. I think that consistency for casing is also going to involve tweaks to the site editor and the customizer since those are also inconsistent.

Screenshot 2024-02-08 at 5 58 34 PM Screenshot 2024-02-08 at 5 58 44 PM

@github-actions
Copy link

github-actions bot commented Feb 9, 2024

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@kebbet
Copy link

kebbet commented Feb 10, 2024

I think the design of the remove button can be improved. Maybe the style of button that deletes a theme can be reused, which is red text as non hover, and white text with red background as hover state.

Could be solved by:

  • adding button button-secondary reset to the reset button
  • adding this css to site-icon.css (copied from themes.css)
.site-icon-section button.reset {
	color: #b32d2e;
	text-decoration: none;
	border-color: transparent;
	box-shadow: none;
	background: transparent;
}

.site-icon-section button.reset:hover {
	background: #b32d2e;
	color: #fff;
	border-color: #b32d2e;
	box-shadow: 0 0 0 1px #b32d2e;
}

@kebbet
Copy link

kebbet commented Feb 10, 2024

See screenshots for example with and without hover
bild
bild

@kebbet
Copy link

kebbet commented Feb 12, 2024

Small nitpick, but maybe add 10px margin between buttons to give them more space? Otherwise I think it looks ok!

like this:
bild

border-color: transparent;
box-shadow: none;
background: transparent;
}
Copy link

Choose a reason for hiding this comment

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

Suggested change
}
margin-left: 10px;
}

aaronjorbin and others added 4 commits February 12, 2024 17:21
Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
@kebbet
Copy link

kebbet commented Feb 12, 2024

Tested handheld view, with possible sv_SE translations. Might need some media-queries for smaller viewports. Remove inline-margins and add top margin to reset-button?

bild

@kebbet
Copy link

kebbet commented Feb 12, 2024

Tested handheld view, with possible sv_SE translations. Might need some media-queries for smaller viewports. Remove inline-margins and add top margin to reset-button?

Strings:
Ändra webbplatsikon
Ta bort webbplatsikon

<div class="favicon-preview">
<img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" alt="">
<div class="favicon">
<img src="<?php site_icon_url(); ?>" alt="Preview as a browser icon">
Copy link
Contributor

Choose a reason for hiding this comment

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

the alt text is not translatable

</div>
<span class="browser-title" aria-hidden="true"><?php echo get_bloginfo( 'name' ); ?></span>
</div>
<img class="app-icon-preview" src="<?php site_icon_url(); ?>" alt="Preview as an app icon">
Copy link
Contributor

Choose a reason for hiding this comment

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

the alt text is not translatable

@joedolson
Copy link
Contributor

This was closed in https://core.trac.wordpress.org/changeset/57602

@joedolson joedolson closed this Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants