BP_REST_Blogs_Endpoint::get_blog_domain( BP_Blogs_Blog $blog )

Get blog permalink.

Description

Parameters

$blog

(Required) Blog object.

Return

(string)

Source

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

365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
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 );
}

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.