Site Icon: Introduce `get_site_icon_url` filter for the icon URL.

Remove `oembed_site_icon_url` filter added in [34903].

Props swissspidy.
Fixes #34411.
Built from https://develop.svn.wordpress.org/trunk@35379


git-svn-id: http://core.svn.wordpress.org/trunk@35343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-10-23 21:17:24 +00:00
parent 902f0f1a98
commit 269a296bb4
2 changed files with 12 additions and 25 deletions

View File

@ -123,21 +123,10 @@ if ( have_posts() ) :
<div class="wp-embed-footer">
<div class="wp-embed-site-title">
<?php
$site_icon_url = get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) );
/**
* Filters the site icon URL for use in the embed template.
*
* @since 4.4.0
*
* @param string $site_icon_url The site icon URL.
*/
$site_icon_url = apply_filters( 'embed_site_icon_url', $site_icon_url );
printf(
'<a href="%s" target="_top"><img src="%s" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>',
esc_url( home_url() ),
esc_url( $site_icon_url ),
esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),
esc_attr( get_bloginfo( 'name' ) )
);
?>
@ -224,21 +213,10 @@ else :
<div class="wp-embed-footer">
<div class="wp-embed-site-title">
<?php
$site_icon_url = get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) );
/**
* Filters the site icon URL for use in the embed template.
*
* @since 4.4.0
*
* @param string $site_icon_url The site icon URL.
*/
$site_icon_url = apply_filters( 'embed_site_icon_url', $site_icon_url );
printf(
'<a href="%s" target="_top"><img src="%s" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>',
esc_url( home_url() ),
esc_url( $site_icon_url ),
esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),
esc_html( get_bloginfo( 'name' ) )
);
?>

View File

@ -776,7 +776,16 @@ function get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {
}
}
return $url;
/**
* Filter the site icon URL.
*
* @site 4.4.0
*
* @param string $url Site icon URL.
* @param int $size Size of the site icon.
* @param int $blog_id ID of the blog to get the site icon for.
*/
return apply_filters( 'get_site_icon_url', $url, $size, $blog_id );
}
/**