bp_get_blogs_visit_blog_button( array|string $args = '' )

Return button for visiting a blog in a loop.


See also

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



(array|string) (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: ''


(string) The HTML for the Visit button.


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

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


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.