WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2015 08:50:48 PM (6 years ago)
Author:
jeremyfelt
Message:

MS: Populate site_name property in a new WP_Network.

This allows us to reduce some extra handling in ms-settings.php. Requires [34777].

Props johnjamesjacoby for the initial patch.
See #31985.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-network.php

    r34585 r34819  
    130130        }
    131131
     132        $this->_set_site_name();
    132133        $this->_set_cookie_domain();
     134    }
     135
     136    /**
     137     * Set the site name assigned to the network if one has not been populated.
     138     *
     139     * @since 4.4.0
     140     * @access private
     141     */
     142    private function _set_site_name() {
     143        if ( ! empty( $this->site_name ) ) {
     144            return;
     145        }
     146
     147        $default = ucfirst( $this->domain );
     148        $this->site_name = get_network_option( 'site_name', $default, $this->id );
    133149    }
    134150
Note: See TracChangeset for help on using the changeset viewer.