bp_get_blogs_visit_blog_button( array|string $args = '' )

Return button for visiting a blog in a loop.

Description

See also

  • BP_Button: for a complete description of arguments and return value.

Parameters

$args

(Optional) Arguments are listed below, with their default values. For a complete description of arguments, see BP_Button.

  • 'id'
    (string) Default: 'visit_blog'.
  • 'component'
    (string) Default: 'blogs'.
  • 'must_be_logged_in'
    (bool) Default: false.
  • 'block_self'
    (bool) Default: false.
  • 'wrapper_class'
    (string) Default: 'blog-button visit'.
  • 'link_href'
    (string) Permalink of the current blog in the loop.
  • 'link_class'
    (string) Default: 'blog-button visit'.
  • 'link_text'
    (string) Default: 'Visit Site'.

Default value: ''

Return

(string) The HTML for the Visit button.

Source

File: bp-blogs/bp-blogs-template.php

1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
function bp_get_blogs_visit_blog_button( $args = '' ) {
    $defaults = array(
        'id'                => 'visit_blog',
        'component'         => 'blogs',
        'must_be_logged_in' => false,
        'block_self'        => false,
        'wrapper_class'     => 'blog-button visit',
        'link_href'         => bp_get_blog_permalink(),
        'link_class'        => 'blog-button visit',
        'link_text'         => __( 'Visit Site', 'buddyboss' ),
    );
 
    $button = wp_parse_args( $args, $defaults );
 
    /**
     * Filters the button for visiting a blog in a loop.
     *
     * @since BuddyPress 1.2.10
     *
     * @param array $button Array of arguments to be used for the button to visit a blog.
     */
    return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
}

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.