Example #1
0
	/**
	 * bp_get_blogs_visit_blog_button()
	 *
	 * Return button for visiting a blog in a loop
	 *
	 * @param array $args Custom button properties
	 * @return string
	 */
	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'        => 'visit',
			'link_text'         => __( 'Visit Blog', 'buddypress' ),
			'link_title'        => __( 'Visit Blog', 'buddypress' ),
		);

		$button = wp_parse_args( $args, $defaults );

		// Filter and return the HTML button
		return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
	}
/**
 * Return button for visiting a blog in a loop.
 *
 * @see BP_Button for a complete description of arguments and return
 *      value.
 *
 * @param array|string $args {
 *     Arguments are listed below, with their default values. For a
 *     complete description of arguments, see {@link BP_Button}.
 *     @type string $id                Default: 'visit_blog'.
 *     @type string $component         Default: 'blogs'.
 *     @type bool   $must_be_logged_in Default: false.
 *     @type bool   $block_self        Default: false.
 *     @type string $wrapper_class     Default: 'blog-button visit'.
 *     @type string $link_href         Permalink of the current blog in the loop.
 *     @type string $link_class        Default: 'blog-button visit'.
 *     @type string $link_text         Default: 'Visit Site'.
 *     @type string $link_title        Default: 'Visit Site'.
 * }
 * @return string The HTML for the Visit button.
 */
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', 'buddypress'), 'link_title' => __('Visit Site', 'buddypress'));
    $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));
}
function bp_blog_permalink()
{
    echo bp_get_blog_permalink();
}