get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d LIMIT 1", $site_id ) ); if ( empty( $_site ) || is_wp_error( $_site ) ) { return false; } wp_cache_add( $site_id, $_site, 'sites' ); } return new WP_Site( $_site ); } /** * Creates a new WP_Site object. * * Will populate object properties from the object provided and assign other * default properties based on that information. * * @since 4.5.0 * @access public * * @param WP_Site|object $site A site object. */ public function __construct( $site ) { foreach( get_object_vars( $site ) as $key => $value ) { $this->$key = $value; } } }