Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/16/2012 02:57:03 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Add the ability to cancel a pending friendship request. Props ddean. Fixes #3897.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-screens.php

    r5712 r5931  
    4646        else
    4747            bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' );
     48
     49        bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
     50       
     51    } elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
     52        // Check the nonce
     53        check_admin_referer( 'friends_withdraw_friendship' );
     54
     55        if ( friends_withdraw_friendship( bp_loggedin_user_id(), bp_action_variable( 1 ) ) )
     56            bp_core_add_message( __( 'Friendship request withdrawn', 'buddypress' ) );
     57        else
     58            bp_core_add_message( __( 'Friendship request could not be withdrawn', 'buddypress' ), 'error' );
    4859
    4960        bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
Note: See TracChangeset for help on using the changeset viewer.