Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #65098


Ignore:
Timestamp:
04/18/2026 07:59:48 PM (7 months ago)
Author:
sabernhardt
Comment:

Hi and welcome to WordPress Core Trac!

I think you might have a plugin or theme that uses the get_site_icon_url filter. I can break the site icon image in embeds by adding this to a custom plugin:

add_filter( 'get_site_icon_url', '__return_empty_string' );

The filter runs at the end of the get_site_icon_url() function, so the fallback WordPress logo would not override that.

The atom_site_icon() and wp_site_icon() functions check the value before trying to print it, and a similar condition probably could fit the_embed_site_title().

function atom_site_icon() {
	$url = get_site_icon_url( 32 );
	if ( $url ) {
		echo '<icon>' . convert_chars( $url ) . "</icon>\n";
	}
}
function wp_site_icon() {
	if ( ! has_site_icon() && ! is_customize_preview() ) {
		return;
	}

	$meta_tags = array();
	$icon_32   = get_site_icon_url( 32 );
	if ( empty( $icon_32 ) && is_customize_preview() ) {
		$icon_32 = '/favicon.ico'; // Serve default favicon URL in customizer so element can be updated for preview.
	}
	if ( $icon_32 ) {
		$meta_tags[] = sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( $icon_32 ) );
	}

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #65098

    • Property Keywords needs-patch added
    • Property Milestone Awaiting Review → 7.1
    • Property Version 6.9.4
  • Ticket #65098 – Description

    initial v1  
    22`get_site_icon_url()` twice, passing a fallback URL as the second argument:
    33
     4{{{
    45    esc_url( get_site_icon_url( 32, includes_url( 'images/w-logo-blue.png' ) ) ),
    56    esc_url( get_site_icon_url( 64, includes_url( 'images/w-logo-blue.png' ) ) ),
     7}}}
    68
    79Despite a Site Icon being properly defined in Appearance → Customize → Site
    … …  
    1113
    1214The generated HTML is:
    13 
     15{{{
    1416    <img src="" srcset=" 2x" width="32" height="32" alt="" class="wp-embed-site-icon">
     17}}}
    1518
    1619Note that `src` is empty and `srcset` contains only ` 2x`, which causes
    … …  
    4346
    4447The following filter removes the broken icon from the embed footer:
    45 
     48{{{
    4649    add_filter('embed_site_title_html', function($site_title) {
    4750        return preg_replace('/<img[^>]+class="wp-embed-site-icon"[^>]*>/i', '', $site_title);
    4851    });
     52}}}
    4953
    5054== Environment ==