Skip to:
Content

BuddyPress.org

Changeset 8546


Ignore:
Timestamp:
06/24/2014 09:23:15 PM (7 years ago)
Author:
r-a-y
Message:

Friends: Tweak bp_member_add_friend_button().

Due to changes in r8514, some code in this function is now redundant.
Therefore, this commit removes this code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-template.php

    r7828 r8546  
    188188
    189189/**
    190  * Output the Add Friend button in member directories.
     190 * Output the "Add Friend" button in the member loop.
     191 *
     192 * @since BuddyPress (1.2.6)
    191193 */
    192194function bp_member_add_friend_button() {
    193     global $members_template;
    194 
    195     if ( !isset( $members_template->member->is_friend ) || null === $members_template->member->is_friend )
    196         $friend_status = 'not_friends';
    197     else
    198         $friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
    199 
    200     echo bp_get_add_friend_button( $members_template->member->id, $friend_status );
     195    bp_add_friend_button( bp_get_member_user_id() );
    201196}
    202197add_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' );
Note: See TracChangeset for help on using the changeset viewer.