Multisite: Remove unnecessary reference parameters.

There is no advantage to passing parameters by reference to `get_site()`, `get_network()`, and `update_site_cache()`.

Props flixos90, ocean90 for review.
See #37615.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2016-08-09 18:12:31 +00:00
parent 822db9ce1d
commit eaffe99260
2 changed files with 6 additions and 6 deletions

View File

@ -481,7 +481,7 @@ function clean_blog_cache( $blog ) {
* @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site. * @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site.
* @return WP_Site|null The site object or null if not found. * @return WP_Site|null The site object or null if not found.
*/ */
function get_site( &$site = null ) { function get_site( $site = null ) {
if ( empty( $site ) ) { if ( empty( $site ) ) {
$site = get_current_blog_id(); $site = get_current_blog_id();
} }
@ -537,9 +537,9 @@ function _prime_site_caches( $ids ) {
* *
* @since 4.6.0 * @since 4.6.0
* *
* @param array $sites Array of site objects, passed by reference. * @param array $sites Array of site objects.
*/ */
function update_site_cache( &$sites ) { function update_site_cache( $sites ) {
if ( ! $sites ) { if ( ! $sites ) {
return; return;
} }
@ -1085,10 +1085,10 @@ function get_networks( $args = array() ) {
* *
* @global WP_Network $current_site * @global WP_Network $current_site
* *
* @param WP_Network|int|null $network Network to retrieve, passed by reference. * @param WP_Network|int|null $network Optional. Network to retrieve. Default is the current network.
* @return WP_Network|null The network object or null if not found. * @return WP_Network|null The network object or null if not found.
*/ */
function get_network( &$network = null ) { function get_network( $network = null ) {
global $current_site; global $current_site;
if ( empty( $network ) && isset( $current_site ) ) { if ( empty( $network ) && isset( $current_site ) ) {
$network = $current_site; $network = $current_site;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7-alpha-38230'; $wp_version = '4.7-alpha-38232';
/** /**
* 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.