wp/wp-includes/class-wp-network.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    87 	 * @since 4.4.0
    87 	 * @since 4.4.0
    88 	 *
    88 	 *
    89 	 * @global wpdb $wpdb WordPress database abstraction object.
    89 	 * @global wpdb $wpdb WordPress database abstraction object.
    90 	 *
    90 	 *
    91 	 * @param int $network_id The ID of the network to retrieve.
    91 	 * @param int $network_id The ID of the network to retrieve.
    92 	 * @return WP_Network|bool The network's object if found. False if not.
    92 	 * @return WP_Network|false The network's object if found. False if not.
    93 	 */
    93 	 */
    94 	public static function get_instance( $network_id ) {
    94 	public static function get_instance( $network_id ) {
    95 		global $wpdb;
    95 		global $wpdb;
    96 
    96 
    97 		$network_id = (int) $network_id;
    97 		$network_id = (int) $network_id;
   324 	 * @since 4.4.0
   324 	 * @since 4.4.0
   325 	 *
   325 	 *
   326 	 * @param string   $domain   Domain to check.
   326 	 * @param string   $domain   Domain to check.
   327 	 * @param string   $path     Path to check.
   327 	 * @param string   $path     Path to check.
   328 	 * @param int|null $segments Path segments to use. Defaults to null, or the full path.
   328 	 * @param int|null $segments Path segments to use. Defaults to null, or the full path.
   329 	 * @return WP_Network|bool Network object if successful. False when no network is found.
   329 	 * @return WP_Network|false Network object if successful. False when no network is found.
   330 	 */
   330 	 */
   331 	public static function get_by_path( $domain = '', $path = '', $segments = null ) {
   331 	public static function get_by_path( $domain = '', $path = '', $segments = null ) {
   332 		$domains = array( $domain );
   332 		$domains = array( $domain );
   333 		$pieces  = explode( '.', $domain );
   333 		$pieces  = explode( '.', $domain );
   334 
   334 
   405 		 * can be found at the requested domain and path. Otherwise, return
   405 		 * can be found at the requested domain and path. Otherwise, return
   406 		 * an object from wp_get_network().
   406 		 * an object from wp_get_network().
   407 		 *
   407 		 *
   408 		 * @since 3.9.0
   408 		 * @since 3.9.0
   409 		 *
   409 		 *
   410 		 * @param null|bool|WP_Network $network  Network value to return by path. Default null
   410 		 * @param null|false|WP_Network $network  Network value to return by path. Default null
   411 		 *                                       to continue retrieving the network.
   411 		 *                                       to continue retrieving the network.
   412 		 * @param string               $domain   The requested domain.
   412 		 * @param string               $domain   The requested domain.
   413 		 * @param string               $path     The requested path, in full.
   413 		 * @param string               $path     The requested path, in full.
   414 		 * @param int|null             $segments The suggested number of paths to consult.
   414 		 * @param int|null             $segments The suggested number of paths to consult.
   415 		 *                                       Default null, meaning the entire path was to be consulted.
   415 		 *                                       Default null, meaning the entire path was to be consulted.