WordPress.org

Make WordPress Core

Changeset 38515


Ignore:
Timestamp:
09/02/2016 11:48:00 PM (3 years ago)
Author:
jeremyfelt
Message:

Multisite: Deprecate wp_get_network().

wp_get_network() was converted into a wrapper for get_network() in 4.6.0 and can now be deprecated.

This moves wp_get_network() to the bottom of ms-load.php as ms-deprecated.php is not available early enough.

Props PieWP, flixos90.
Fixes #37553.

File:
1 edited

Legend:

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

    r38201 r38515  
    132132function get_network_by_path( $domain, $path, $segments = null ) {
    133133    return WP_Network::get_by_path( $domain, $path, $segments );
    134 }
    135 
    136 /**
    137  * Retrieve an object containing information about the requested network.
    138  *
    139  * @since 3.9.0
    140  *
    141  * @internal In 4.6.0, converted to use get_network()
    142  *
    143  * @param object|int $network The network's database row or ID.
    144  * @return WP_Network|false Object containing network information if found, false if not.
    145  */
    146 function wp_get_network( $network ) {
    147     $network = get_network( $network );
    148     if ( null === $network ) {
    149         return false;
    150     }
    151 
    152     return $network;
    153134}
    154135
     
    543524    return $current_site;
    544525}
     526
     527/**
     528 * Retrieve an object containing information about the requested network.
     529 *
     530 * @since 3.9.0
     531 * @deprecated 4.7.0 Use `get_network()`
     532 * @see get_network()
     533 *
     534 * @internal In 4.6.0, converted to use get_network()
     535 *
     536 * @param object|int $network The network's database row or ID.
     537 * @return WP_Network|false Object containing network information if found, false if not.
     538 */
     539function wp_get_network( $network ) {
     540    _deprecated_function( __FUNCTION__, '4.7.0', 'get_network()' );
     541
     542    $network = get_network( $network );
     543    if ( null === $network ) {
     544        return false;
     545    }
     546
     547    return $network;
     548}
Note: See TracChangeset for help on using the changeset viewer.