Skip to:
Content

BuddyPress.org

Ticket #2566: bp_button.patch

File bp_button.patch, 42.0 KB (added by johnjamesjacoby, 14 years ago)
  • bp-activity/bp-activity-templatetags.php

     
    921921        function bp_get_send_public_message_link() {
    922922                global $bp;
    923923
    924                 return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
     924                if ( bp_is_my_profile() || !is_user_logged_in() )
     925                        return false;
     926
     927                return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
    925928        }
    926929
     930function bp_send_public_message_button() {
     931        bp_button( array(
     932                'id'                => 'public_message',
     933                'component'         => 'activity',
     934                'must_be_logged_in' => true,
     935                'block_self'        => true,
     936                'wrapper_id'        => 'post-mention',
     937                'link_href'         => bp_get_send_public_message_link(),
     938                'link_title'        => __( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ),
     939                'link_text'         => __( 'Mention this User', 'buddypress' )
     940        ) );
     941}
     942
     943 No newline at end of file
    927944function bp_activity_post_form_action() {
    928945        echo bp_get_activity_post_form_action();
    929946}
  • bp-blogs/bp-blogs-templatetags.php

     
    504504<?php
    505505}
    506506
     507/**
     508 * bp_blogs_visit_blog_button()
     509 *
     510 * Button for visiting a blog in a loop
     511 */
     512function bp_blogs_visit_blog_button() {
     513        bp_button( array (
     514                'id'                => 'visit_blog',
     515                'component'         => 'blogs',
     516                'must_be_logged_in' => false,
     517                'block_self'        => false,
     518
     519                'wrapper_class'     => 'blog-button visit',
     520
     521                'link_href'         => bp_get_blog_permalink(),
     522                'link_class'        => 'visit',
     523                'link_text'         => __( 'Visit Blog', 'buddypress' ),
     524                'link_title'        => __( 'Visit Blog', 'buddypress' ),
     525        ) );
     526}
     527
    507528?>
  • bp-core/bp-core-classes.php

     
    495495        }
    496496}
    497497
     498/**
     499 * BP_Button
     500 *
     501 * API to create BuddyPress buttons
     502 *
     503 * @package BuddyPress Core
     504 * @since 1.2.6
     505 */
     506class BP_Button {
    498507
     508        // Button properties
     509        var $id;
     510        var $component;
     511        var $must_be_logged_in;
     512        var $block_self;
     513
     514        // Wrapper div
     515        var $wrapper_class;
     516        var $wrapper_id;
     517
     518        // Button
     519        var $link_href;
     520        var $link_class;
     521        var $link_id;
     522        var $link_rel;
     523        var $link_title;
     524        var $link_text;
     525
     526        // HTML result
     527        var $contents;
     528
     529        /**
     530         * bp_button()
     531         *
     532         * Builds the button based on passed parameters:
     533         *
     534         * component: Which component this button is for
     535         * must_be_logged_in: Button only appears for logged in users
     536         * block_self: Button will not appear when viewing your own profile.
     537         * wrapper_id: The DOM ID of the button wrapper
     538         * wrapper_class: The DOM class of the button wrapper
     539         * link_href: The destination link of the button
     540         * link_title: Title of the button
     541         * link_id: The DOM ID of the button
     542         * link_class: The DOM class of the button
     543         * link_rel: The DOM rel of the button
     544         * link_text: The contents of the button
     545         *
     546         * @param array $args
     547         * @return bool False if not allowed
     548         */
     549        function bp_button( $args = '' ) {
     550
     551                $defaults = array(
     552                        'id'                => '',
     553                        'component'         => 'core',
     554                        'must_be_logged_in' => true,
     555                        'block_self'        => true,
     556
     557                        'wrapper_id'        => '',
     558                        'wrapper_class'     => '',
     559
     560                        'link_href'         => '',
     561                        'link_title'        => '',
     562                        'link_id'           => '',
     563                        'link_class'        => '',
     564                        'link_rel'          => '',
     565                        'link_text'         => '',
     566                );
     567
     568                $r = wp_parse_args( $args, $defaults );
     569                extract( $r, EXTR_SKIP );
     570
     571                // Required button properties
     572                $this->id                = $id;
     573                $this->component         = $component;
     574                $this->must_be_logged_in = (bool)$must_be_logged_in;
     575                $this->block_self        = (bool)$block_self;
     576
     577                // $id and $component are required
     578                if ( empty( $id ) || empty( $component ) )
     579                        return false;
     580
     581                // No button if component is not active
     582                if ( !bp_is_active( $this->component ) )
     583                        return false;
     584
     585                // No button for guests if must be logged in
     586                if ( true == $this->must_be_logged_in && !is_user_logged_in )
     587                        return false;
     588
     589                // No button if viewing your own profile
     590                if ( true == $this->block_self && bp_is_my_profile() )
     591                        return false;
     592
     593                // Wrapper properties
     594                if ( !empty( $wrapper_id ) )
     595                        $this->wrapper_id    = ' id="' . $wrapper_id . '"';
     596
     597                if ( !empty( $wrapper_class ) )
     598                        $this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"';
     599                else
     600                        $this->wrapper_class = ' class="generic-button"';
     601
     602                // Link properties
     603                if ( !empty( $link_id ) )
     604                        $this->link_id       = ' id="' . $link_id . '"';
     605
     606                if ( !empty( $link_href ) )
     607                        $this->link_href     = ' href="' . $link_href . '"';
     608
     609                if ( !empty( $link_title ) )
     610                        $this->link_title    = ' title="' . $link_title . '"';
     611
     612                if ( !empty( $link_rel ) )
     613                        $this->link_rel      = ' rel="' . $link_rel . '"';
     614
     615                if ( !empty( $link_class ) )
     616                        $this->link_class    = ' class="' . $link_class . '"';
     617
     618                if ( !empty( $link_text ) )
     619                        $this->link_text     = $link_text;
     620
     621                // Build the button
     622                $this->contents  = '<div' . $this->wrapper_class . $this->wrapper_id . '>';
     623                $this->contents .= '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>';
     624                $this->contents .= '</div>';
     625
     626                // Allow button to be manipulated externally
     627                $this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this );
     628        }
     629
     630        /**
     631         * contents()
     632         *
     633         * Return contents of button
     634         *
     635         * @return string
     636         */
     637        function contents() {
     638                return $this->contents;
     639        }
     640
     641        /**
     642         * display()
     643         *
     644         * Output contents of button
     645         */
     646        function display() {
     647                if ( !empty( $this->contents ) )
     648                        echo $this->contents;
     649        }
     650}
     651
    499652?>
  • bp-core/bp-core-templatetags.php

     
    417417                return apply_filters( 'bp_member_last_active', $registered );
    418418        }
    419419
    420 function bp_member_add_friend_button() {
    421         global $members_template;
    422 
    423         if ( function_exists( 'bp_add_friend_button' ) ) {
    424                 if ( null === $members_template->member->is_friend )
    425                         $friend_status = 'not_friends';
    426                 else
    427                         $friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
    428 
    429                 echo bp_add_friend_button( $members_template->member->id, $friend_status );
    430         }
    431 }
    432 
    433 function bp_member_total_friend_count() {
    434         global $members_template;
    435 
    436         echo bp_get_member_total_friend_count();
    437 }
    438         function bp_get_member_total_friend_count() {
    439                 global $members_template;
    440 
    441                 if ( 1 == (int) $members_template->member->total_friend_count )
    442                         return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
    443                 else
    444                         return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
    445         }
    446 
    447420function bp_member_random_profile_data() {
    448421        global $members_template;
    449422
     
    10991072}
    11001073
    11011074/**
     1075 * bp_button( $button )
     1076 *
     1077 * Creates and outputs a button.
     1078 * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text
     1079 *
     1080 * @param array $button
     1081 */
     1082function bp_button( $button = '' ) {
     1083        echo bp_get_button( $button );
     1084}
     1085        /**
     1086         * bp_get_button( $button )
     1087         *
     1088         * Creates and returns a button.
     1089         * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text
     1090         *
     1091         * @param array $button
     1092         * @return string
     1093         */
     1094        function bp_get_button( $button = '' ) {
     1095                $btn = new BP_Button( $button );
     1096                return apply_filters( 'bp_get_button', $btn->contents, $button );
     1097        }
     1098
     1099/**
     1100 No newline at end of file
    11021101 * bp_create_excerpt()
    11031102 *
    11041103 * Fakes an excerpt on any content. Will not truncate words.
  • bp-core/bp-core-widgets.php

     
    2121        function widget($args, $instance) {
    2222                global $bp;
    2323
    24             extract( $args );
     24                extract( $args );
    2525
    2626                echo $before_widget;
    2727                echo $before_title
     
    3131                <?php if ( bp_has_members( 'user_id=0&type=newest&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
    3232                        <div class="item-options" id="members-list-options">
    3333                                <span class="ajax-loader" id="ajax-loader-members"></span>
    34                                 <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a> |
    35                                 <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a> |
    36                                 <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
     34                                <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a>
     35                                |  <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a>
     36
     37                                <?php if ( bp_is_active( 'friends' ) ) : ?>
     38
     39                                        | <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
     40
     41                                <?php endif; ?>
     42
    3743                        </div>
    3844
    3945                        <ul id="members-list" class="item-list">
     
    147153        function widget($args, $instance) {
    148154                global $bp;
    149155
    150             extract( $args );
     156                extract( $args );
    151157
    152158                echo $before_widget;
    153159                echo $before_title
     
    201207        switch ( $_POST['filter'] ) {
    202208                case 'newest-members':
    203209                        $type = 'newest';
    204                 break;
     210                        break;
     211
    205212                case 'recently-active-members':
    206213                        $type = 'active';
    207                 break;
     214                        break;
     215
    208216                case 'popular-members':
    209                         $type = 'popular';
    210                 break;
     217                        if ( bp_is_active( 'friends' ) )
     218                                $type = 'popular';
     219                        else
     220                                $type = 'active';
     221
     222                        break;
    211223        }
    212224
    213225        if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=0' ) ) : ?>
     
    223235                                                <div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
    224236                                                <?php if ( 'active' == $type || 'newest' == $type ) : ?>
    225237                                                        <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
    226                                                 <?php else : ?>
    227  No newline at end of file
     238                                                <?php elseif ( bp_is_active( 'friends' ) ) : ?>
     239 No newline at end of file
    228240                                                        <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
    229241                                                <?php endif; ?>
  • bp-friends/bp-friends-templatetags.php

     					</div>
     
    104104        ?>
    105105                <form action="<?php echo $action ?>" id="friend-search-form" method="post">
    106106
    107                 <label for="friend-search-box" id="friend-search-label"><?php echo $label ?></label>
    108                 <input type="search" name="friend-search-box" id="friend-search-box" value="<?php echo $value ?>"<?php echo $disabled ?> />
     107                        <label for="friend-search-box" id="friend-search-label"><?php echo $label ?></label>
     108                        <input type="search" name="friend-search-box" id="friend-search-box" value="<?php echo $value ?>"<?php echo $disabled ?> />
    109109
    110                 <?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?>
    111                 <input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( $bp->displayed_user->id ) ?>" />
     110                        <?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?>
     111                        <input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( $bp->displayed_user->id ) ?>" />
    112112
    113113                </form>
    114114        <?php
    115115}
    116116
     117function bp_member_add_friend_button() {
     118        global $members_template;
     119
     120        if ( function_exists( 'bp_add_friend_button' ) ) {
     121                if ( null === $members_template->member->is_friend )
     122                        $friend_status = 'not_friends';
     123                else
     124                        $friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
     125
     126                echo bp_add_friend_button( $members_template->member->id, $friend_status );
     127        }
     128}
     129add_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' );
     130
     131function bp_member_total_friend_count() {
     132        global $members_template;
     133
     134        echo bp_get_member_total_friend_count();
     135}
     136        function bp_get_member_total_friend_count() {
     137                global $members_template;
     138
     139                if ( 1 == (int) $members_template->member->total_friend_count )
     140                        return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
     141                else
     142                        return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
     143        }
     144
     145/**
     146 * bp_potential_friend_id( $user_id )
     147 *
     148 * Outputs the ID of the potential friend
     149 *
     150 * @uses bp_get_potential_friend_id()
     151 * @param <type> $user_id
     152 */
     153function bp_potential_friend_id( $user_id = 0 ) {
     154        echo bp_get_potential_friend_id( $user_id );
     155}
     156        /**
     157         * bp_get_potential_friend_id( $user_id )
     158         *
     159         * Returns the ID of the potential friend
     160         *
     161         * @global object $bp
     162         * @global object $friends_template
     163         * @param int $user_id
     164         * @return int ID of potential friend
     165         */
     166        function bp_get_potential_friend_id( $user_id = 0 ) {
     167                global $bp, $friends_template;
     168
     169                if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) )
     170                        $user_id = $friends_template->friendship->friend->id;
     171                else if ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
     172                        $user_id = $bp->displayed_user->id;
     173
     174                return apply_filters( 'bp_get_potential_friend_id', (int)$user_id );
     175        }
     176
     177/**
     178 * bp_is_friend( $user_id )
     179 *
     180 * Returns - 'is_friend', 'not_friends', 'pending'
     181 *
     182 * @global object $bp
     183 * @param int $potential_friend_id
     184 * @return string
     185 */
     186function bp_is_friend( $user_id = 0 ) {
     187        global $bp;
     188
     189        if ( !is_user_logged_in() )
     190                return false;
     191
     192        if ( empty( $user_id ) )
     193                $user_id = bp_get_potential_friend_id( $user_id );
     194
     195        if ( $bp->loggedin_user->id == $user_id )
     196                return false;
     197
     198        return apply_filters( 'bp_is_friend', friends_check_friendship_status( $bp->loggedin_user->id, $user_id ), $user_id );
     199}
     200
    117201function bp_add_friend_button( $potential_friend_id = false, $friend_status = false ) {
    118202        echo bp_get_add_friend_button( $potential_friend_id, $friend_status );
    119203}
    120204        function bp_get_add_friend_button( $potential_friend_id = false, $friend_status = false ) {
    121205                global $bp, $friends_template;
    122206
    123                 if ( !is_user_logged_in() )
    124                         return false;
     207                if ( empty( $potential_friend_id ) )
     208                        $potential_friend_id = bp_get_potential_friend_id( $potential_friend_id );
    125209
    126                 if ( !$potential_friend_id && $friends_template->friendship->friend )
    127                         $potential_friend_id = $friends_template->friendship->friend->id;
    128                 else if ( !$potential_friend_id && !$friends_template->friendship->friend )
    129                         $potential_friend_id = $bp->displayed_user->id;
     210                $is_friend = bp_is_friend( $potential_friend_id );
    130211
    131                 if ( $bp->loggedin_user->id == $potential_friend_id )
     212                if ( empty( $is_friend ) )
    132213                        return false;
    133214
    134                 if ( empty( $friend_status ) )
    135                         $friend_status = friends_check_friendship_status( $bp->loggedin_user->id, $potential_friend_id );
     215                switch ( $is_friend ) {
     216                        case 'pending' :
     217                                $btn = array(
     218                                        'id'                => 'pending',
     219                                        'component'         => 'friends',
     220                                        'must_be_logged_in' => true,
     221                                        'block_self'        => true,
     222                                        'wrapper_class'     => 'friendship-button pending',
     223                                        'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
     224                                        'link_class'        => 'requested',
     225                                        'link_href'         => trailingslashit( $bp->loggedin_user->domain . $bp->friends->slug ),
     226                                        'link_text'         => __( 'Friendship Requested', 'buddypress' ),
     227                                        'link_title'        => __( 'Friendship Requested', 'buddypress' )
     228                                );
     229                                break;
    136230
    137                 $button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">';
     231                        case 'is_friend' :
     232                                $btn = array(
     233                                        'id'                => 'is_friend',
     234                                        'component'         => 'friends',
     235                                        'must_be_logged_in' => true,
     236                                        'block_self'        => true,
     237                                        'wrapper_class'     => 'friendship-button is_friend',
     238                                        'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
     239                                        'link_class'        => '',
     240                                        'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ),
     241                                        'link_text'         => __( 'Cancel Friendship', 'buddypress' ),
     242                                        'link_title'        => __( 'Cancel Friendship', 'buddypress' ),
     243                                        'link_id'           => 'friend-' . $potential_friend_id,
     244                                        'link_rel'          => 'remove',
     245                                        'link_class'        => 'remove'
     246                                );
     247                                break;
    138248
    139                 if ( 'pending' == $friend_status )
    140                         $button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
    141                 else if ( 'is_friend' == $friend_status )
    142                         $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>';
    143                 else
    144                         $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>';
     249                        default:
     250                                $btn = array(
     251                                        'id'                => 'not_friends',
     252                                        'component'         => 'friends',
     253                                        'must_be_logged_in' => true,
     254                                        'block_self'        => true,
     255                                        'wrapper_class'     => 'friendship-button not_friends',
     256                                        'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
     257                                        'link_class'        => '',
     258                                        'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),
     259                                        'link_text'         => __( 'Add Friend', 'buddypress' ),
     260                                        'link_title'        => __( 'Add Friend', 'buddypress' ),
     261                                        'link_id'           => 'friend-' . $potential_friend_id,
     262                                        'link_rel'          => 'add',
     263                                        'link_class'        => 'add'
     264                                );
     265                                break;
     266                }
    145267
    146                 $button .= '</div>';
     268                $button = new BP_Button( $btn );
    147269
    148                 return apply_filters( 'bp_get_add_friend_button', $button, $potential_friend_id, $friend_status );
     270                return apply_filters( 'bp_get_add_friend_button', $button->contents, $potential_friend_id, $friend_status );
    149271        }
    150272
    151273function bp_get_friend_ids( $user_id = false ) {
     
    181303                return apply_filters( 'bp_get_friend_friendship_id', $friendship_id );
    182304        }
    183305
     306function bp_friend_request_link() {
     307        echo bp_get_friend_request_link();
     308}
     309        function bp_get_friend_request_link() {
     310                global $bp;
     311
     312                $friend_id = bp_get_potential_friend_id();
     313                $is_friend = bp_is_friend();
     314
     315                if ( empty( $is_friend ) )
     316                        return false;
     317
     318                switch ( $is_friend ) {
     319                        case 'pending' :
     320                                $link = $bp->loggedin_user->domain . $bp->friends->slug;
     321                                break;
     322                        case 'is_friend' :
     323                                $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $friend_id . '/', 'friends_remove_friend' );
     324                                break;
     325                        default:
     326                                $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $friend_id . '/', 'friends_add_friend' );
     327                                break;
     328                }
     329
     330                return apply_filters( 'bp_get_friend_request_link', $link, $friend_id, $is_friend );
     331        }
     332
     333function bp_friend_request_id() {
     334        echo bp_get_friend_request_id();
     335}
     336        function bp_get_friend_request_id() {
     337
     338                $friend_id = bp_get_potential_friend_id();
     339                $is_friend = bp_is_friend();
     340
     341                if ( empty( $is_friend ) )
     342                        return false;
     343
     344                switch ( $is_friend ) {
     345                        case 'pending' :
     346                                $id = '';
     347                                break;
     348                        case 'is_friend' :
     349                                $id = 'friend-' . $friend_id;
     350                                break;
     351                        default:
     352                                $id = 'friend-' . $friend_id;
     353                                break;
     354                }
     355
     356                return apply_filters( 'bp_get_friend_request_id', $id, $friend_id, $is_friend );
     357        }
     358
     359function bp_friend_request_rel() {
     360        echo bp_get_friend_request_rel();
     361}
     362        function bp_get_friend_request_rel() {
     363
     364                $friend_id = bp_get_potential_friend_id();
     365                $is_friend = bp_is_friend();
     366
     367                if ( empty( $is_friend ) )
     368                        return false;
     369
     370                switch ( $is_friend ) {
     371                        case 'pending' :
     372                                $rel = '';
     373                                break;
     374                        case 'is_friend' :
     375                                $rel = 'remove';
     376                                break;
     377                        default:
     378                                $rel = 'add';
     379                                break;
     380                }
     381
     382                return apply_filters( 'bp_get_friend_request_rel', $rel, $friend_id, $is_friend );
     383        }
     384
     385function bp_friend_request_class() {
     386        echo bp_get_friend_request_class();
     387}
     388        function bp_get_friend_request_class() {
     389
     390                $friend_id = bp_get_potential_friend_id();
     391                $is_friend = bp_is_friend();
     392
     393                if ( empty( $is_friend ) )
     394                        return false;
     395
     396                switch ( $is_friend ) {
     397                        case 'pending' :
     398                                $class = 'pending';
     399                                break;
     400                        case 'is_friend' :
     401                                $class = 'remove';
     402                                break;
     403                        default:
     404                                $class = 'add';
     405                                break;
     406                }
     407
     408                return apply_filters( 'bp_get_friend_request_class', $class, $friend_id, $is_friend );
     409        }
     410
     411function bp_friend_request_link_text() {
     412        echo bp_get_friend_request_link_text();
     413}
     414        function bp_get_friend_request_link_text() {
     415
     416                $friend_id = bp_get_potential_friend_id();
     417                $is_friend = bp_is_friend();
     418
     419                if ( empty( $is_friend ) )
     420                        return false;
     421
     422                switch ( $is_friend ) {
     423                        case 'pending' :
     424                                $text = __( 'Friendship Requested', 'buddypress' );
     425                                break;
     426                        case 'is_friend' :
     427                                $text = __( 'Cancel Friendship', 'buddypress' );
     428                                break;
     429                        default:
     430                                $text = __( 'Add Friend', 'buddypress' );
     431                                break;
     432                }
     433
     434                return apply_filters( 'bp_get_friend_request_link_text', $text, $friend_id, $is_friend );
     435        }
     436
     437 No newline at end of file
    184438function bp_friend_accept_request_link() {
    185439        echo bp_get_friend_accept_request_link();
    186440}
  • bp-groups/bp-groups-templatetags.php

     
    10951095        return true;
    10961096}
    10971097
     1098function bp_group_new_topic_button() {
     1099        if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) {
     1100                bp_button( array (
     1101                        'id'                => 'new_topic',
     1102                        'component'         => 'groups',
     1103                        'must_be_logged_in' => true,
     1104                        'block_self'        => true,
     1105                        'wrapper_class'     => 'group-button',
     1106                        'link_href'         => '#post-new',
     1107                        'link_class'        => '',
     1108                        'link_text'         => __( 'New Topic', 'buddypress' ),
     1109                        'link_title'        => __( 'New Topic', 'buddypress' ),
     1110                ) );
     1111        }
     1112}
     1113
    10981114function bp_group_join_button( $group = false ) {
    1099         global $bp, $groups_template;
     1115        echo bp_get_group_join_button();
     1116}
     1117        function bp_get_group_join_button( $group = false ) {
     1118                global $bp, $groups_template;
    11001119
    1101         if ( !$group )
    1102                 $group =& $groups_template->group;
     1120                if ( !$group )
     1121                        $group =& $groups_template->group;
    11031122
    1104         // If they're not logged in or are banned from the group, no join button.
    1105         if ( !is_user_logged_in() || $group->is_banned )
    1106                 return false;
     1123                // If they're not logged in or are banned from the group, no join button.
     1124                if ( !is_user_logged_in() || $group->is_banned )
     1125                        return false;
    11071126
    1108         if ( !$group->status )
    1109                 return false;
     1127                if ( !$group->status )
     1128                        return false;
    11101129
    1111         if ( 'hidden' == $group->status && !$group->is_member )
    1112                 return false;
     1130                if ( 'hidden' == $group->status && !$group->is_member )
     1131                        return false;
    11131132
    1114         echo '<div class="generic-button group-button ' . $group->status . '" id="groupbutton-' . $group->id . '">';
     1133                // Already a member
     1134                if ( $group->is_member ) {
     1135                        $btn = array(
     1136                                'id'                => 'leave_group',
     1137                                'component'         => 'groups',
     1138                                'must_be_logged_in' => true,
     1139                                'block_self'        => false,
     1140                                'wrapper_class'     => 'group-button ' . $group->status,
     1141                                'wrapper_id'        => 'groupbutton-' . $group->id,
     1142                                'link_class'        => 'leave-group',
     1143                                'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ),
     1144                                'link_text'         => __( 'Leave Group', 'buddypress' ),
     1145                                'link_title'        => __( 'Leave Group', 'buddypress' )
     1146                        );
    11151147
    1116         switch ( $group->status ) {
    1117                 case 'public':
    1118                         if ( $group->is_member )
    1119                                 echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
    1120                         else
    1121                                 echo '<a class="join-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
    1122                 break;
     1148                // Not a member
     1149                } else {
    11231150
    1124                 case 'private':
    1125                         if ( $group->is_member ) {
    1126                                 echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
    1127                         } else {
    1128                                 if ( !bp_group_has_requested_membership( $group ) )
    1129                                         echo '<a class="request-membership" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ) . '">' . __('Request Membership', 'buddypress') . '</a>';
    1130                                 else
    1131                                         echo '<a class="membership-requested" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>';
     1151                        // Show different buttons based on group status
     1152                        switch ( $group->status ) {
     1153                                case 'public':
     1154                                        $btn = array(
     1155                                                'id'                => 'join_group',
     1156                                                'component'         => 'groups',
     1157                                                'must_be_logged_in' => true,
     1158                                                'block_self'        => false,
     1159                                                'wrapper_class'     => 'group-button ' . $group->status,
     1160                                                'wrapper_id'        => 'groupbutton-' . $group->id,
     1161                                                'link_class'        => 'join-group',
     1162                                                'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ),
     1163                                                'link_text'         => __( 'Join Group', 'buddypress' ),
     1164                                                'link_title'        => __( 'Join Group', 'buddypress' )
     1165                                        );
     1166                                        break;
     1167
     1168                                case 'private' :
     1169
     1170                                        // Member has not requested membership yet
     1171                                        if ( !bp_group_has_requested_membership( $group ) ) {
     1172                                                $btn = array(
     1173                                                        'id'                => 'requeste_membership',
     1174                                                        'component'         => 'groups',
     1175                                                        'must_be_logged_in' => true,
     1176                                                        'block_self'        => false,
     1177                                                        'wrapper_class'     => 'group-button ' . $group->status,
     1178                                                        'wrapper_id'        => 'groupbutton-' . $group->id,
     1179                                                        'link_class'        => 'request-membership',
     1180                                                        'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ),
     1181                                                        'link_text'         => __( 'Request Membership', 'buddypress' ),
     1182                                                        'link_title'        => __( 'Request Membership', 'buddypress' ),
     1183                                                );
     1184
     1185                                        // Member has requested membership already
     1186                                        } else {
     1187                                                $btn = array(
     1188                                                        'id'                => 'membership_requested',
     1189                                                        'component'         => 'groups',
     1190                                                        'must_be_logged_in' => true,
     1191                                                        'block_self'        => false,
     1192                                                        'wrapper_class'     => 'group-button ' . $group->status,
     1193                                                        'wrapper_id'        => 'groupbutton-' . $group->id,
     1194                                                        'link_class'        => 'membership-requested',
     1195                                                        'link_href'         => bp_get_group_permalink( $group ),
     1196                                                        'link_text'         => __( 'Request Sent', 'buddypress' ),
     1197                                                        'link_title'        => __( 'Request Sent', 'buddypress' ),
     1198                                                );
     1199                                        }
     1200
     1201                                        break;
    11321202                        }
    1133                 break;
     1203                }
    11341204
    1135                 case 'hidden':
    1136                         if ( $group->is_member )
    1137                                 echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
    1138                 break;
     1205                $button = new BP_Button( $btn );
     1206
     1207                return apply_filters( 'bp_group_join_button', $button->contents, $group );
    11391208        }
    11401209
    1141         echo '</div>';
    1142 }
    1143 
    11441210function bp_group_status_message( $group = false ) {
    11451211        global $groups_template;
    11461212
     
    19852051}
    19862052
    19872053function bp_group_request_reject_link() {
    1988         global $requests_template, $groups_template;
    1989 
    1990         echo apply_filters( 'bp_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) );
     2054        echo bp_get_group_request_reject_link();
    19912055}
     2056        function bp_get_group_request_reject_link() {
     2057                global $requests_template, $groups_template;
    19922058
     2059                return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) );
     2060        }
     2061
    19932062function bp_group_request_accept_link() {
    1994         global $requests_template, $groups_template;
     2063        echo bp_get_group_request_accept_link();
     2064}
     2065        function bp_get_group_request_accept_link() {
     2066                global $requests_template, $groups_template;
    19952067
    1996         echo apply_filters( 'bp_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );
     2068                return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );
     2069        }
     2070
     2071function bp_group_request_user_link() {
     2072        echo bp_get_group_request_user_link();
    19972073}
     2074        function bp_get_group_request_user_link() {
     2075                global $requests_template;
    19982076
     2077                return apply_filters( 'bp_get_group_request_user_link', bp_core_get_userlink( $requests_template->request->user_id ) );
     2078        }
     2079
    19992080function bp_group_request_time_since_requested() {
    20002081        global $requests_template;
    20012082
     
    20082089        echo apply_filters( 'bp_group_request_comment', strip_tags( stripslashes( $requests_template->request->comments ) ) );
    20092090}
    20102091
    2011 function bp_group_request_user_link() {
    2012         global $requests_template;
    2013 
    2014         echo apply_filters( 'bp_group_request_user_link', bp_core_get_userlink( $requests_template->request->user_id ) );
    2015 }
    2016 
    2017 
    2018  No newline at end of file
    20192092/************************************************************************************
    20202093 * Invite Friends Template Tags
    20212094 **/
  • bp-messages/bp-messages-templatetags.php

     
    501501        function bp_get_send_private_message_link() {
    502502                global $bp;
    503503
    504                 return apply_filters( 'bp_get_send_private_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
     504                if ( bp_is_my_profile() || !is_user_logged_in() )
     505                        return false;
     506
     507                return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
    505508        }
    506509
     510/**
     511 * bp_send_private_message_button()
     512 *
     513 * Explicitly named function to avoid confusion with public messages.
     514 *
     515 * @uses bp_get_send_message_button()
     516 * @since 1.2.6
     517 */
     518function bp_send_private_message_button() {
     519        echo bp_get_send_message_button();
     520}
     521
    507522function bp_send_message_button() {
    508523        echo bp_get_send_message_button();
    509524}
    510525        function bp_get_send_message_button() {
    511                 global $bp;
    512 
    513                 if ( bp_is_my_profile() || !is_user_logged_in() )
    514                         return false;
    515 
    516                 return apply_filters( 'bp_get_send_message_button', '<div class="generic-button"><a class="send-message" title="' . __( 'Send Message', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) . '">' . __( 'Send Message', 'buddypress' ) . '</a></div>' );
    517  No newline at end of file
     526                return apply_filters( 'bp_get_send_message_button',
     527                        bp_get_button( array(
     528                                'id'                => 'private_message',
     529                                'component'         => 'messages',
     530                                'must_be_logged_in' => true,
     531                                'block_self'        => true,
     532                                'wrapper_id'        => 'send-private-message',
     533                                'link_href'         => bp_get_send_private_message_link(),
     534                                'link_class'        => 'send-message',
     535                                'link_title'        => __( 'Send a private message to this user.', 'buddypress' ),
     536                                'link_text'         => __( 'Send Private Message', 'buddypress' )
     537                        ) )
     538                );
     539 No newline at end of file
    518540        }
    519541
  • bp-themes/bp-default/blogs/blogs-loop.php

     function bp_message_loading_image_src() {
     
    3434                        </div>
    3535
    3636                        <div class="action">
    37                                 <div class="generic-button blog-button visit">
    38                                         <a href="<?php bp_blog_permalink() ?>" class="visit" title="<?php _e( 'Visit Blog', 'buddypress' ) ?>"><?php _e( 'Visit Blog', 'buddypress' ) ?></a>
    39                                 </div>
    4037
     38                                <?php do_action( 'bp_directory_blogs_actions' ) ?>
     39
    4140                                <div class="meta">
    4241                                        <?php bp_blog_latest_post() ?>
    4342                                </div>
    4443
    45                                 <?php do_action( 'bp_directory_blogs_actions' ) ?>
    4644                        </div>
    4745
    4846                        <div class="clear"></div>
  • bp-themes/bp-default/functions.php

     
    333333}
    334334if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" )
    335335        add_action( 'admin_notices', 'bp_dtheme_show_notice' );
     336
     337
     338// Member Buttons
     339add_action( 'bp_member_header_actions',    'bp_add_friend_button' );
     340add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
     341add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
     342
     343// Group Buttons
     344add_action( 'bp_group_header_actions',     'bp_group_join_button' );
     345add_action( 'bp_group_header_actions',     'bp_group_new_topic_button' );
     346add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
     347
     348// Blog Buttons
     349add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
     350
    336351?>
  • bp-themes/bp-default/groups/groups-loop.php

     
    3333                                <div class="item-desc"><?php bp_group_description_excerpt() ?></div>
    3434
    3535                                <?php do_action( 'bp_directory_groups_item' ) ?>
     36
    3637                        </div>
    3738
    3839                        <div class="action">
    39                                 <?php bp_group_join_button() ?>
    4040
     41                                <?php do_action( 'bp_directory_groups_actions' ) ?>
     42
    4143                                <div class="meta">
     44
    4245                                        <?php bp_group_type() ?> / <?php bp_group_member_count() ?>
     46
    4347                                </div>
    4448
    45                                 <?php do_action( 'bp_directory_groups_actions' ) ?>
    4649                        </div>
    4750
    4851                        <div class="clear"></div>
  • bp-themes/bp-default/groups/single/admin.php

     
    116116                        </p>
    117117
    118118                        <?php if ( bp_get_group_has_avatar() ) : ?>
     119
    119120                                <p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
    120121
    121                                 <div class="generic-button" id="delete-group-avatar-button">
    122                                         <a class="edit" href="<?php bp_group_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete Avatar', 'buddypress' ) ?></a>
    123                                 </div>
     122                                <?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'buddypress' ), 'link_text' => __( 'Delete Avatar', 'buddypress' ) ) ); ?>
     123
    124124                        <?php endif; ?>
    125125
    126126                        <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
     
    260260
    261261                                        <div class="action">
    262262
    263                                                 <div class="generic-button accept">
    264                                                         <a href="<?php bp_group_request_accept_link() ?>"><?php _e( 'Accept', 'buddypress' ); ?></a>
    265                                                 </div>
     263                                                <?php bp_button( array( 'id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __( 'Accept', 'buddypress' ), 'link_text' => __( 'Accept', 'buddypress' ) ) ); ?>
    266264
    267                                          &nbsp;
     265                                                <?php bp_button( array( 'id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __( 'Reject', 'buddypress' ), 'link_text' => __( 'Reject', 'buddypress' ) ) ); ?>
    268266
    269                                                 <div class="generic-button reject">
    270                                                         <a href="<?php bp_group_request_reject_link() ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
    271                                                 </div>
    272 
    273267                                                <?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
    274268
    275269                                        </div>
  • bp-themes/bp-default/groups/single/group-header.php

     
    3535        <div id="item-meta">
    3636                <?php bp_group_description() ?>
    3737
    38                 <?php if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) : ?>
    39                         <div class="generic-button group-button">
    40                                 <a href="#post-new" class=""><?php _e( 'New Topic', 'buddypress' ) ?></a>
    41                         </div>
    42                 <?php endif; ?>
     38                <div id="item-buttons">
    4339
    44                 <?php bp_group_join_button() ?>
     40                        <?php do_action( 'bp_group_header_actions' ); ?>
    4541
     42                </div><!-- #item-buttons -->
     43
     44 No newline at end of file
    4645                <?php do_action( 'bp_group_header_meta' ) ?>
    4746        </div>
    4847</div><!-- #item-header-content -->
  • bp-themes/bp-default/members/members-loop.php

     
    2929                        <div class="item">
    3030                                <div class="item-title">
    3131                                        <a href="<?php bp_member_permalink() ?>"><?php bp_member_name() ?></a>
     32
    3233                                        <?php if ( bp_get_member_latest_update() ) : ?>
     34
    3335                                                <span class="update"> - <?php bp_member_latest_update( 'length=10' ) ?></span>
     36
    3437                                        <?php endif; ?>
     38
    3539                                </div>
     40
    3641                                <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
    3742
    3843                                <?php do_action( 'bp_directory_members_item' ) ?>
     
    4146                                 /***
    4247                                  * If you want to show specific profile fields here you can,
    4348                                  * but it'll add an extra query for each member in the loop
    44                                   * (only one regadless of the number of fields you show):
     49                                  * (only one regardless of the number of fields you show):
    4550                                  *
    4651                                  * bp_member_profile_data( 'field=the field name' );
    4752                                  */
     
    4954                        </div>
    5055
    5156                        <div class="action">
    52                                 <?php bp_member_add_friend_button() ?>
    5357
    54                                 <?php do_action( 'bp_directory_members_actions' ) ?>
     58                                <?php do_action( 'bp_directory_members_actions' ); ?>
     59
    5560                        </div>
    5661
    5762                        <div class="clear"></div>
  • bp-themes/bp-default/members/single/member-header.php

     
    2121                <?php endif; ?>
    2222
    2323                <div id="item-buttons">
    24                         <?php if ( function_exists( 'bp_add_friend_button' ) ) : ?>
    25                                 <?php bp_add_friend_button() ?>
    26                         <?php endif; ?>
    2724
    28                         <?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_public_message_link' ) ) : ?>
    29                                 <div class="generic-button" id="post-mention">
    30                                         <a href="<?php bp_send_public_message_link() ?>" title="<?php _e( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ) ?>"><?php _e( 'Mention this User', 'buddypress' ) ?></a>
    31                                 </div>
    32                         <?php endif; ?>
     25                        <?php do_action( 'bp_member_header_actions' ); ?>
    3326
    34                         <?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_private_message_link' ) ) : ?>
    35                                 <div class="generic-button" id="send-private-message">
    36                                         <a href="<?php bp_send_private_message_link() ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a>
    37                                 </div>
    38                         <?php endif; ?>
    39  No newline at end of file
    4027                </div><!-- #item-buttons -->
    4128
    4229                <?php
  • bp-xprofile/bp-xprofile-templatetags.php

     
    685685function bp_edit_profile_button() {
    686686        global $bp;
    687687
    688         ?>
    689         <div class="generic-button">
    690                 <a class="edit" title="<?php _e( 'Edit Profile', 'buddypress' ) ?>" href="<?php echo $bp->displayed_user->domain . $bp->profile->slug ?>/edit"><?php _e( 'Edit Profile', 'buddypress' ) ?></a>
    691         </div>
    692         <?php
     688        bp_button( array (
     689                'id'                => 'edit_profile',
     690                'component'         => 'xprofile',
     691                'must_be_logged_in' => true,
     692                'block_self'        => true,
     693                'link_href'         => trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit' ),
     694                'link_class'        => 'edit',
     695                'link_text'         => __( 'Edit Profile', 'buddypress' ),
     696                'link_title'        => __( 'Edit Profile', 'buddypress' ),
     697        ) );
    693698}
    694699
    695 
    696700?>