Changeset 13441 for trunk/src/bp-friends/bp-friends-template.php
- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-template.php
r13434 r13441 378 378 379 379 $friendship_status = bp_is_friend( $potential_friend_id ); 380 $friends_slug = bp_get_friends_slug(); 381 $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ); 380 382 381 383 if ( empty( $friendship_status ) ) { … … 392 394 'wrapper_class' => 'friendship-button pending_friend', 393 395 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 394 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $potential_friend_id . '/', 'friends_withdraw_friendship' ), 396 'link_href' => wp_nonce_url( 397 bp_loggedin_user_url( 398 array( 399 'single_item_component' => $custom_friends_slug, 400 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 401 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_cancel', 'cancel' ), $potential_friend_id ), 402 ) 403 ), 404 'friends_withdraw_friendship' 405 ), 395 406 'link_text' => __( 'Cancel Friendship Request', 'buddypress' ), 396 407 'link_title' => __( 'Cancel Friendship Requested', 'buddypress' ), … … 409 420 'wrapper_class' => 'friendship-button awaiting_response_friend', 410 421 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 411 'link_href' => bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/', 422 'link_href' => bp_loggedin_user_url( 423 array( 424 'single_item_component' => $custom_friends_slug, 425 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 426 ) 427 ), 412 428 'link_text' => __( 'Friendship Requested', 'buddypress' ), 413 429 'link_title' => __( 'Friendship Requested', 'buddypress' ), … … 426 442 'wrapper_class' => 'friendship-button is_friend', 427 443 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 428 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ), 444 'link_href' => wp_nonce_url( 445 bp_loggedin_user_url( 446 array( 447 'single_item_component' => $custom_friends_slug, 448 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_remove_friend', 'remove-friend' ), 449 'single_item_action_variables' => array( $potential_friend_id ), 450 ) 451 ), 452 'friends_remove_friend' 453 ), 429 454 'link_text' => __( 'Cancel Friendship', 'buddypress' ), 430 455 'link_title' => __( 'Cancel Friendship', 'buddypress' ), … … 443 468 'wrapper_class' => 'friendship-button not_friends', 444 469 'wrapper_id' => 'friendship-button-' . $potential_friend_id, 445 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ), 470 'link_href' => wp_nonce_url( 471 bp_loggedin_user_url( 472 array( 473 'single_item_component' => $custom_friends_slug, 474 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_add_friend', 'add-friend' ), 475 'single_item_action_variables' => array( $potential_friend_id ), 476 ) 477 ), 478 'friends_add_friend' 479 ), 446 480 'link_text' => __( 'Add Friend', 'buddypress' ), 447 481 'link_title' => __( 'Add Friend', 'buddypress' ), … … 610 644 } 611 645 646 $friends_slug = bp_get_friends_slug(); 647 $url = wp_nonce_url( 648 bp_loggedin_user_url( 649 array( 650 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 651 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 652 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_accept', 'accept' ), $friendship_id ), 653 ) 654 ), 655 'friends_accept_friendship' 656 ); 657 612 658 /** 613 659 * Filters the URL for accepting the current friendship request in the loop. … … 616 662 * @since 2.6.0 Added the `$friendship_id` parameter. 617 663 * 618 * @param string $ valueAccept-friendship URL.664 * @param string $url Accept-friendship URL. 619 665 * @param int $friendship_id ID of the friendship. 620 666 */ 621 return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id ), 'friends_accept_friendship' ), $friendship_id );667 return apply_filters( 'bp_get_friend_accept_request_link', $url, $friendship_id ); 622 668 } 623 669 … … 647 693 } 648 694 695 $friends_slug = bp_get_friends_slug(); 696 $url = wp_nonce_url( 697 bp_loggedin_user_url( 698 array( 699 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ), 700 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 701 'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_reject', 'reject' ), $friendship_id ), 702 ) 703 ), 704 'friends_reject_friendship' 705 ); 706 649 707 /** 650 708 * Filters the URL for rejecting the current friendship request in the loop. … … 653 711 * @since 2.6.0 Added the `$friendship_id` parameter. 654 712 * 655 * @param string $ valueReject-friendship URL.713 * @param string $url Reject-friendship URL. 656 714 * @param int $friendship_id ID of the friendship. 657 715 */ 658 return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id ), 'friends_reject_friendship' ), $friendship_id );716 return apply_filters( 'bp_get_friend_reject_request_link', $url, $friendship_id ); 659 717 } 660 718
Note: See TracChangeset
for help on using the changeset viewer.