From 731c255aee26a309a734a88680b8793e7fff3069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Mon, 10 Aug 2015 20:15:26 +0000 Subject: [PATCH] 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 --- wp-includes/feed.php | 4 ++-- wp-includes/general-template.php | 36 ++++++++++++++++---------------- wp-includes/version.php | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 41c7dac432..f40f41a6ad 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -560,7 +560,7 @@ function prep_atom_text_construct($data) { * @see get_site_icon_url() */ function atom_site_icon() { - $url = get_site_icon_url( null, 32 ); + $url = get_site_icon_url( 32 ); if ( $url ) { echo "$url\n"; } @@ -577,7 +577,7 @@ function rss2_site_icon() { $rss_title = get_bloginfo_rss( 'name' ); } - $url = get_site_icon_url( null, 32 ); + $url = get_site_icon_url( 32 ); if ( $url ) { echo ' diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 97b780a2cc..6ed04e27ad 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -724,14 +724,14 @@ function get_bloginfo( $show = '', $filter = 'raw' ) { /** * 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 string $url Fallback url if no site icon is found. - * @return string Site Icon URL. + * @param int $size Size of the site icon. + * @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. */ -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 ( ! is_int( $blog_id ) ) { + if ( ! $blog_id ) { $blog_id = get_current_blog_id(); } $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. * - * @param null|int $blog_id Id of the blog to get the site icon for. - * @param int $size Size of the site icon. - * @param string $url Fallback url if no site icon is found. + * @param int $size Size of the site icon. + * @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 = '' ) { - echo esc_url( get_site_icon_url( $blog_id, $size, $url ) ); +function site_icon_url( $size = 512, $url = '', $blog_id = 0 ) { + echo esc_url( get_site_icon_url( $size, $url, $blog_id ) ); } /** * 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 */ -function has_site_icon( $blog_id = null ) { - return !! get_site_icon_url( $blog_id, 512 ); +function has_site_icon( $blog_id = 0 ) { + return !! get_site_icon_url( 512, '', $blog_id ); } /** @@ -2450,10 +2450,10 @@ function wp_site_icon() { } $meta_tags = array( - sprintf( '', esc_url( get_site_icon_url( null, 32 ) ) ), - sprintf( '', esc_url( get_site_icon_url( null, 192 ) ) ), - sprintf( '', esc_url( get_site_icon_url( null, 180 ) ) ), - sprintf( '', esc_url( get_site_icon_url( null, 270 ) ) ), + sprintf( '', esc_url( get_site_icon_url( 32 ) ) ), + sprintf( '', esc_url( get_site_icon_url( 192 ) ) ), + sprintf( '', esc_url( get_site_icon_url( 180 ) ) ), + sprintf( '', esc_url( get_site_icon_url( 270 ) ) ), ); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 6c19d72891..9b8870c5a5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.