BP_REST_Blogs_Endpoint::get_blog_domain( stdClass $blog )

Get blog permalink.


Parameters Parameters

$blog

(stdClass) (Required) Blog object.


Top ↑

Return Return

(string)


Source Source

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

	protected function get_blog_domain( $blog ) {

		// Bail early.
		if ( empty( $blog->domain ) && empty( $blog->path ) ) {
			return '';
		}

		if ( empty( $blog->domain ) && ! empty( $blog->path ) ) {
			return bp_get_root_domain() . $blog->path;
		}

		$protocol  = is_ssl() ? 'https://' : 'http://';
		$permalink = $protocol . $blog->domain . $blog->path;

		return apply_filters( 'bp_get_blog_permalink', $permalink );
	}


Top ↑

User Contributed Notes User Contributed Notes

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