BP_REST_Blogs_Endpoint::get_blog_object( int $blog_id )

Get a blog object from a blog_id.


Parameters Parameters

$blog_id

(int) (Required) Blog ID.


Top ↑

Return Return

(stdClass|int)


Source Source

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

	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;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.