BP_REST_Blogs_Endpoint::get_blog_object( int $blog_id )

Get a blog object from a blog_id.

Description

Parameters

$blog_id

(Required) Blog ID.

Return

(stdClass|int)

Source

File: bp-blogs/classes/class-bp-rest-blogs-endpoint.php

390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
public function get_blog_object( $blog_id ) {
    $blogs = current(
        bp_blogs_get_blogs(
            array(
                'include_blog_ids' => array( $blog_id ),
            )
        )
    );
 
    if ( ! empty( $blogs[0] ) ) {
        return $blogs[0];
    }
 
    return 0;
}

Changelog

Changelog
Version Description
0.1.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.