Skip to:
Content

BuddyPress.org

Ticket #7700: 0001-add-missing-button-classes-to-ajax-friend-response.patch

File 0001-add-missing-button-classes-to-ajax-friend-response.patch, 3.2 KB (added by chherbst, 8 years ago)
  • bp-templates/bp-legacy/buddypress-functions.php

    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() {  
    13991399                if ( ! friends_remove_friend( bp_loggedin_user_id(), $friend_id ) ) {
    14001400                        echo __( 'Friendship could not be canceled.', 'buddypress' );
    14011401                } 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>';
    14031403                }
    14041404
    14051405        // Trying to request friendship.
    function bp_legacy_theme_ajax_addremove_friend() {  
    14091409                if ( ! friends_add_friend( bp_loggedin_user_id(), $friend_id ) ) {
    14101410                        echo __(' Friendship could not be requested.', 'buddypress' );
    14111411                } 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>';
    14131413                }
    14141414
    14151415        // Trying to cancel pending request.
    function bp_legacy_theme_ajax_addremove_friend() {  
    14171417                check_ajax_referer( 'friends_withdraw_friendship' );
    14181418
    14191419                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>';
    14211421                } else {
    14221422                        echo __("Friendship request could not be cancelled.", 'buddypress');
    14231423                }