Ticket #5734: 5734.friend_button.patch
File 5734.friend_button.patch, 2.8 KB (added by , 10 years ago) |
---|
-
src/bp-friends/bp-friends-template.php
291 291 * @return string HTML for the Add Friend button. 292 292 */ 293 293 function bp_get_add_friend_button( $potential_friend_id = 0, $friend_status = false ) { 294 global $members_template; 294 295 295 if ( empty( $potential_friend_id ) ) 296 if ( empty( $potential_friend_id ) ) { 296 297 $potential_friend_id = bp_get_potential_friend_id( $potential_friend_id ); 298 } 297 299 298 300 $is_friend = bp_is_friend( $potential_friend_id ); 299 301 300 if ( empty( $is_friend ) ) 302 if ( empty( $is_friend ) ) { 301 303 return false; 304 } 305 306 $block_self = ! empty( $members_template->in_the_loop ) ? false : true; 302 307 303 308 switch ( $is_friend ) { 304 309 case 'pending' : … … 306 311 'id' => 'pending', 307 312 'component' => 'friends', 308 313 'must_be_logged_in' => true, 309 'block_self' => true,314 'block_self' => $block_self, 310 315 'wrapper_class' => 'friendship-button pending_friend', 311 316 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 312 317 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $potential_friend_id . '/', 'friends_withdraw_friendship' ), … … 323 328 'id' => 'awaiting_response', 324 329 'component' => 'friends', 325 330 'must_be_logged_in' => true, 326 'block_self' => true,331 'block_self' => $block_self, 327 332 'wrapper_class' => 'friendship-button awaiting_response_friend', 328 333 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 329 334 'link_href' => bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/', … … 340 345 'id' => 'is_friend', 341 346 'component' => 'friends', 342 347 'must_be_logged_in' => true, 343 'block_self' => false,348 'block_self' => $block_self, 344 349 'wrapper_class' => 'friendship-button is_friend', 345 350 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 346 351 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ), … … 357 362 'id' => 'not_friends', 358 363 'component' => 'friends', 359 364 'must_be_logged_in' => true, 360 'block_self' => true,365 'block_self' => $block_self, 361 366 'wrapper_class' => 'friendship-button not_friends', 362 367 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 363 368 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),