Changeset 2372 for trunk/bp-friends/bp-friends-templatetags.php
- Timestamp:
- 01/19/2010 09:26:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-templatetags.php
r2332 r2372 161 161 } 162 162 163 function bp_friend_accept_request_link() { 164 echo bp_get_friend_accept_request_link(); 165 } 166 // You only have the user ID but you need the friendship ID !! 167 168 function bp_get_friend_accept_request_link() { 163 function bp_friend_friendship_id() { 164 echo bp_get_friend_friendship_id(); 165 } 166 function bp_get_friend_friendship_id() { 169 167 global $members_template, $bp; 170 168 … … 174 172 } 175 173 176 return apply_filters( 'bp_get_friend_ accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ));177 } 178 179 function bp_friend_ reject_request_link() {180 echo bp_get_friend_ reject_request_link();181 } 182 function bp_get_friend_ reject_request_link() {174 return apply_filters( 'bp_get_friend_friendship_id', $friendship_id ); 175 } 176 177 function bp_friend_accept_request_link() { 178 echo bp_get_friend_accept_request_link(); 179 } 180 function bp_get_friend_accept_request_link() { 183 181 global $members_template, $bp; 184 182 … … 188 186 } 189 187 188 return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) ); 189 } 190 191 function bp_friend_reject_request_link() { 192 echo bp_get_friend_reject_request_link(); 193 } 194 function bp_get_friend_reject_request_link() { 195 global $members_template, $bp; 196 197 if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id ) ) { 198 $friendship_id = friends_get_friendship_id( $members_template->member->id, $bp->loggedin_user->id ); 199 wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id, $friendship_id, 'bp' ); 200 } 201 190 202 return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) ); 191 203 }
Note: See TracChangeset
for help on using the changeset viewer.