Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2010 01:08:31 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Committing patch from #2566 for easier review and testing. Adds BP_Button class and associated template tags. Also includes code formatting fixes, phpdoc, widget fixes when friends component is disabled, and possibly the kitchen sink.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-blogs/bp-blogs-templatetags.php

    r3245 r3260  
    505505}
    506506
     507/**
     508 * bp_blogs_visit_blog_button()
     509 *
     510 * Output button for visiting a blog in a loop
     511 *
     512 * @param array $args Custom button properties
     513 */
     514function bp_blogs_visit_blog_button( $args = '' ) {
     515    echo bp_get_blogs_visit_blog_button( $args );
     516}
     517    /**
     518     * bp_get_blogs_visit_blog_button()
     519     *
     520     * Return button for visiting a blog in a loop
     521     *
     522     * @param array $args Custom button properties
     523     * @return string
     524     */
     525    function bp_get_blogs_visit_blog_button( $args = '' ) {
     526        $defaults = array(
     527            'id'                => 'visit_blog',
     528            'component'         => 'blogs',
     529            'must_be_logged_in' => false,
     530            'block_self'        => false,
     531            'wrapper_class'     => 'blog-button visit',
     532            'link_href'         => bp_get_blog_permalink(),
     533            'link_class'        => 'visit',
     534            'link_text'         => __( 'Visit Blog', 'buddypress' ),
     535            'link_title'        => __( 'Visit Blog', 'buddypress' ),
     536        );
     537
     538        $button = wp_parse_args( $args, $defaults );
     539
     540        // Filter and return the HTML button
     541        return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
     542    }
     543
    507544?>
Note: See TracChangeset for help on using the changeset viewer.