Make WordPress Core


Ignore:
Timestamp:
08/09/2016 06:11:12 PM (8 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-blogs.php

    r38217 r38232  
    482482 * @return WP_Site|null The site object or null if not found.
    483483 */
    484 function get_site( &$site = null ) {
     484function get_site( $site = null ) {
    485485    if ( empty( $site ) ) {
    486486        $site = get_current_blog_id();
     
    538538 * @since 4.6.0
    539539 *
    540  * @param array $sites Array of site objects, passed by reference.
    541  */
    542 function update_site_cache( &$sites ) {
     540 * @param array $sites Array of site objects.
     541 */
     542function update_site_cache( $sites ) {
    543543    if ( ! $sites ) {
    544544        return;
     
    10861086 * @global WP_Network $current_site
    10871087 *
    1088  * @param WP_Network|int|null $network Network to retrieve, passed by reference.
     1088 * @param WP_Network|int|null $network Optional. Network to retrieve. Default is the current network.
    10891089 * @return WP_Network|null The network object or null if not found.
    10901090 */
    1091 function get_network( &$network = null ) {
     1091function get_network( $network = null ) {
    10921092    global $current_site;
    10931093    if ( empty( $network ) && isset( $current_site ) ) {
Note: See TracChangeset for help on using the changeset viewer.