site_icon_url() WordPress Function

The site_icon_url() function is used to retrieve the URL of the site icon. The site icon is used as a favicon, as well as in the Site Identity section of the Customizer.

site_icon_url( int $size = 512, string $url = '', int $blog_id ) #

Displays the Site Icon URL.


Parameters

$size

(int)(Optional) Size of the site icon. Default 512 (pixels).

Default value: 512

$url

(string)(Optional) Fallback url if no site icon is found.

Default value: ''

$blog_id

(int)(Optional) ID of the blog to get the site icon for. Default current blog.


Top ↑

Source

File: wp-includes/general-template.php

function site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {
	echo esc_url( get_site_icon_url( $size, $url, $blog_id ) );
}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More