From 6ec1ecbe29025c9399d1cd72e28d3f37ae6f3d35 Mon Sep 17 00:00:00 2001
From: Christoph Herbst <chris.p.herbst@gmail.com>
Date: Wed, 17 May 2017 11:17:32 +0200
Subject: [PATCH] add missing button classes to ajax friend response
fixes styling after friend request action
---
bp-templates/bp-legacy/buddypress-functions.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bp-templates/bp-legacy/buddypress-functions.php b/bp-templates/bp-legacy/buddypress-functions.php
index ade8604..c3260ea 100644
|
a
|
b
|
function bp_legacy_theme_ajax_addremove_friend() {
|
| 1399 | 1399 | if ( ! friends_remove_friend( bp_loggedin_user_id(), $friend_id ) ) { |
| 1400 | 1400 | echo __( 'Friendship could not be canceled.', 'buddypress' ); |
| 1401 | 1401 | } else { |
| 1402 | | echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; |
| | 1402 | echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; |
| 1403 | 1403 | } |
| 1404 | 1404 | |
| 1405 | 1405 | // Trying to request friendship. |
| … |
… |
function bp_legacy_theme_ajax_addremove_friend() {
|
| 1409 | 1409 | if ( ! friends_add_friend( bp_loggedin_user_id(), $friend_id ) ) { |
| 1410 | 1410 | echo __(' Friendship could not be requested.', 'buddypress' ); |
| 1411 | 1411 | } else { |
| 1412 | | echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove" rel="remove" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $friend_id . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; |
| | 1412 | echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove friendship-button pending_friend requested" rel="remove" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $friend_id . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; |
| 1413 | 1413 | } |
| 1414 | 1414 | |
| 1415 | 1415 | // Trying to cancel pending request. |
| … |
… |
function bp_legacy_theme_ajax_addremove_friend() {
|
| 1417 | 1417 | check_ajax_referer( 'friends_withdraw_friendship' ); |
| 1418 | 1418 | |
| 1419 | 1419 | if ( friends_withdraw_friendship( bp_loggedin_user_id(), $friend_id ) ) { |
| 1420 | | echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; |
| | 1420 | echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; |
| 1421 | 1421 | } else { |
| 1422 | 1422 | echo __("Friendship request could not be cancelled.", 'buddypress'); |
| 1423 | 1423 | } |