Site icon: Rearrange function parameters to avoid frequently passing empty values.

props obenland.
fixes #33325.

Built from https://develop.svn.wordpress.org/trunk@33605


git-svn-id: http://core.svn.wordpress.org/trunk@33572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2015-08-10 20:15:26 +00:00
parent 48712a0309
commit 731c255aee
3 changed files with 21 additions and 21 deletions

View File

@ -560,7 +560,7 @@ function prep_atom_text_construct($data) {
* @see get_site_icon_url() * @see get_site_icon_url()
*/ */
function atom_site_icon() { function atom_site_icon() {
$url = get_site_icon_url( null, 32 ); $url = get_site_icon_url( 32 );
if ( $url ) { if ( $url ) {
echo "<icon>$url</icon>\n"; echo "<icon>$url</icon>\n";
} }
@ -577,7 +577,7 @@ function rss2_site_icon() {
$rss_title = get_bloginfo_rss( 'name' ); $rss_title = get_bloginfo_rss( 'name' );
} }
$url = get_site_icon_url( null, 32 ); $url = get_site_icon_url( 32 );
if ( $url ) { if ( $url ) {
echo ' echo '
<image> <image>

View File

@ -724,14 +724,14 @@ function get_bloginfo( $show = '', $filter = 'raw' ) {
/** /**
* Returns the Site Icon URL. * Returns the Site Icon URL.
* *
* @param null|int $blog_id Id of the blog to get the site icon for.
* @param int $size Size of the site icon. * @param int $size Size of the site icon.
* @param string $url Fallback url if no site icon is found. * @param string $url Fallback url if no site icon is found.
* @param int $blog_id Id of the blog to get the site icon for.
* @return string Site Icon URL. * @return string Site Icon URL.
*/ */
function get_site_icon_url( $blog_id = null, $size = 512, $url = '' ) { function get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {
if ( function_exists( 'get_blog_option' ) ) { if ( function_exists( 'get_blog_option' ) ) {
if ( ! is_int( $blog_id ) ) { if ( ! $blog_id ) {
$blog_id = get_current_blog_id(); $blog_id = get_current_blog_id();
} }
$site_icon_id = get_blog_option( $blog_id, 'site_icon' ); $site_icon_id = get_blog_option( $blog_id, 'site_icon' );
@ -755,22 +755,22 @@ function get_site_icon_url( $blog_id = null, $size = 512, $url = '' ) {
/** /**
* Displays the Site Icon URL. * Displays the Site Icon URL.
* *
* @param null|int $blog_id Id of the blog to get the site icon for.
* @param int $size Size of the site icon. * @param int $size Size of the site icon.
* @param string $url Fallback url if no site icon is found. * @param string $url Fallback url if no site icon is found.
* @param int $blog_id Id of the blog to get the site icon for.
*/ */
function site_icon_url( $blog_id = null, $size = 512, $url = '' ) { function site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {
echo esc_url( get_site_icon_url( $blog_id, $size, $url ) ); echo esc_url( get_site_icon_url( $size, $url, $blog_id ) );
} }
/** /**
* Whether the site has a Site Icon. * Whether the site has a Site Icon.
* *
* @param int|null $blog_id Optional. Blog ID. Default: Current blog. * @param int $blog_id Optional. Blog ID. Default: Current blog.
* @return bool * @return bool
*/ */
function has_site_icon( $blog_id = null ) { function has_site_icon( $blog_id = 0 ) {
return !! get_site_icon_url( $blog_id, 512 ); return !! get_site_icon_url( 512, '', $blog_id );
} }
/** /**
@ -2450,10 +2450,10 @@ function wp_site_icon() {
} }
$meta_tags = array( $meta_tags = array(
sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( get_site_icon_url( null, 32 ) ) ), sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( get_site_icon_url( 32 ) ) ),
sprintf( '<link rel="icon" href="%s" sizes="192x192" />', esc_url( get_site_icon_url( null, 192 ) ) ), sprintf( '<link rel="icon" href="%s" sizes="192x192" />', esc_url( get_site_icon_url( 192 ) ) ),
sprintf( '<link rel="apple-touch-icon-precomposed" href="%s">', esc_url( get_site_icon_url( null, 180 ) ) ), sprintf( '<link rel="apple-touch-icon-precomposed" href="%s">', esc_url( get_site_icon_url( 180 ) ) ),
sprintf( '<meta name="msapplication-TileImage" content="%s">', esc_url( get_site_icon_url( null, 270 ) ) ), sprintf( '<meta name="msapplication-TileImage" content="%s">', esc_url( get_site_icon_url( 270 ) ) ),
); );
/** /**

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-RC2-33604'; $wp_version = '4.3-RC2-33605';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.