Changeset 13441 for trunk/src/bp-friends/screens/requests.php
- Timestamp:
- 03/23/2023 07:35:38 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/screens/requests.php
r13092 r13441 14 14 */ 15 15 function friends_screen_requests() { 16 $redirect = false; 17 16 18 if ( bp_is_action_variable( 'accept', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { 17 19 // Check the nonce. 18 20 check_admin_referer( 'friends_accept_friendship' ); 19 21 20 if ( friends_accept_friendship( bp_action_variable( 1 ) ) ) 22 if ( friends_accept_friendship( bp_action_variable( 1 ) ) ) { 21 23 bp_core_add_message( __( 'Friendship accepted', 'buddypress' ) ); 22 else24 } else { 23 25 bp_core_add_message( __( 'Friendship could not be accepted', 'buddypress' ), 'error' ); 26 } 24 27 25 bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );28 $redirect = true; 26 29 27 30 } elseif ( bp_is_action_variable( 'reject', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { … … 29 32 check_admin_referer( 'friends_reject_friendship' ); 30 33 31 if ( friends_reject_friendship( bp_action_variable( 1 ) ) ) 34 if ( friends_reject_friendship( bp_action_variable( 1 ) ) ) { 32 35 bp_core_add_message( __( 'Friendship rejected', 'buddypress' ) ); 33 else36 } else { 34 37 bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' ); 38 } 35 39 36 bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );40 $redirect = true; 37 41 38 42 } elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { … … 40 44 check_admin_referer( 'friends_withdraw_friendship' ); 41 45 42 if ( friends_withdraw_friendship( bp_loggedin_user_id(), bp_action_variable( 1 ) ) ) 46 if ( friends_withdraw_friendship( bp_loggedin_user_id(), bp_action_variable( 1 ) ) ) { 43 47 bp_core_add_message( __( 'Friendship request withdrawn', 'buddypress' ) ); 44 else48 } else { 45 49 bp_core_add_message( __( 'Friendship request could not be withdrawn', 'buddypress' ), 'error' ); 50 } 46 51 47 bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) ); 52 $redirect = true; 53 } 54 55 if ( $redirect ) { 56 $friends_slug = bp_get_friends_slug(); 57 58 bp_core_redirect( 59 bp_loggedin_user_url( 60 array( 61 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 62 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 63 ) 64 ) 65 ); 48 66 } 49 67
Note: See TracChangeset
for help on using the changeset viewer.