$this->getSiteDomain( true ), 'path' => $this->getHomePath( true ) ]; } /** * Returns the network ID. * * @since 1.0.0 * * @return int The integer of the blog/site id. */ public function getNetworkId() { if ( is_multisite() ) { return get_network()->site_id; } return get_current_blog_id(); } /** * Wrapper for switch_to_blog especially for non-multisite setups. * * @since 1.0.0 * * @param int $blogId The blog ID to switch to. * @return bool True in all cases. */ public function switchToBlog( $blogId ) { if ( ! is_multisite() ) { return true; } return switch_to_blog( $blogId ); } /** * Wrapper for restore_current_blog especially for non-multisite setups. * * @since 1.0.0 * * @return bool Whether we're already on the current blog or not in a multisite environment. */ public function restoreCurrentBlog() { if ( ! is_multisite() ) { return false; } return restore_current_blog(); } }