WordPress.org

Make WordPress Core

Ticket #27003: 27003.20.diff

File 27003.20.diff, 1.7 KB (added by jeremyfelt, 6 years ago)

Deprecate get_current_site_name()

  • src/wp-includes/deprecated.php

     
    34303430function default_topic_count_text( $count ) {
    34313431        return $count;
    34323432}
     3433
     3434/**
     3435 * Sets current site name.
     3436 *
     3437 * @access private
     3438 * @since 3.0.0
     3439 * @deprecated 3.9.0
     3440 * @return object $current_site object with site_name
     3441 */
     3442function get_current_site_name( $current_site ) {
     3443        _deprecated_function( __FUNCTION__, '3.9', 'wp_get_network()' );
     3444
     3445        return wp_get_network( $current_site->id );
     3446}
     3447 No newline at end of file
  • src/wp-includes/ms-load.php

     
    113113}
    114114
    115115/**
    116  * Sets current site name.
    117  *
    118  * @todo deprecate
    119  *
    120  * @access private
    121  * @since 3.0.0
    122  * @return object $current_site object with site_name
    123  */
    124 function get_current_site_name( $current_site ) {
    125         global $wpdb;
    126 
    127         $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
    128         if ( ! $current_site->site_name ) {
    129                 $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
    130                 if ( ! $current_site->site_name )
    131                         $current_site->site_name = ucfirst( $current_site->domain );
    132                 wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' );
    133         }
    134 
    135         return $current_site;
    136 }
    137 
    138 /**
    139116 * Retrieve a network object by its domain and path.
    140117 *
    141118 * @since 3.9.0