- Timestamp:
- 06/18/2023 04:11:04 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r13493 r13503 915 915 } 916 916 917 $activity_slug = bp_get_activity_slug();918 $custom_activity_slug = bp_rewrites_get_slug( 'members', 'member_' . $activity_slug, $activity_slug );919 920 917 // We need to calculate and return the feed URL for each scope. 921 918 switch ( $scope ) { 922 919 case 'friends': 923 $feed_url = bp_loggedin_user_url( 924 array( 925 'single_item_component' => $custom_activity_slug, 926 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_friends', 'friends' ), 927 'single_item_action_variables' => array( 'feed' ), 928 ) 929 ); 920 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'friends', array( 'feed' ) ) ) ); 930 921 break; 931 922 case 'groups': 932 $feed_url = bp_loggedin_user_url( 933 array( 934 'single_item_component' => $custom_activity_slug, 935 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_groups', 'groups' ), 936 'single_item_action_variables' => array( 'feed' ), 937 ) 938 ); 923 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'groups', array( 'feed' ) ) ) ); 939 924 break; 940 925 case 'favorites': 941 $feed_url = bp_loggedin_user_url( 942 array( 943 'single_item_component' => $custom_activity_slug, 944 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_favorites', 'favorites' ), 945 'single_item_action_variables' => array( 'feed' ), 946 ) 947 ); 926 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'favorites', array( 'feed' ) ) ) ); 948 927 break; 949 928 case 'mentions': 950 $feed_url = bp_loggedin_user_url( 951 array( 952 'single_item_component' => $custom_activity_slug, 953 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $activity_slug . '_mentions', 'mentions' ), 954 'single_item_action_variables' => array( 'feed' ), 955 ) 956 ); 929 $feed_url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_activity_slug(), 'mentions', array( 'feed' ) ) ) ); 957 930 958 931 if ( isset( $_POST['_wpnonce_activity_filter'] ) && wp_verify_nonce( wp_unslash( $_POST['_wpnonce_activity_filter'] ), 'activity_filter' ) ) { … … 1492 1465 } 1493 1466 1494 $friends_slug = bp_get_friends_slug();1495 $custom_friends_slug = bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug );1496 1497 1467 // Trying to cancel friendship. 1498 1468 if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { … … 1502 1472 echo __( 'Friendship could not be canceled.', 'buddypress' ); 1503 1473 } else { 1504 $url = bp_loggedin_user_url( 1505 array( 1506 'single_item_component' => $custom_friends_slug, 1507 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_add_friend', 'add-friend' ), 1508 'single_item_action_variables' => array( $friend_id ), 1509 ) 1510 ); 1474 $url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'add-friend', array( $friend_id ) ) ) ); 1511 1475 echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( $url, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; 1512 1476 } … … 1519 1483 echo __(' Friendship could not be requested.', 'buddypress' ); 1520 1484 } else { 1521 $url = bp_loggedin_user_url( 1522 array( 1523 'single_item_component' => $custom_friends_slug, 1524 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests', 'requests' ), 1525 'single_item_action_variables' => array( 1526 bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_requests_cancel', 'cancel' ), 1527 $friend_id, 1528 ), 1529 ) 1530 ); 1485 $url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'requests', array( 'cancel', $friend_id ) ) ) ); 1531 1486 echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove friendship-button pending_friend requested" rel="remove" href="' . wp_nonce_url( $url, 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; 1532 1487 } … … 1537 1492 1538 1493 if ( friends_withdraw_friendship( bp_loggedin_user_id(), $friend_id ) ) { 1539 $url = bp_loggedin_user_url( 1540 array( 1541 'single_item_component' => $custom_friends_slug, 1542 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_add_friend', 'add-friend' ), 1543 'single_item_action_variables' => array( 1544 $friend_id, 1545 ), 1546 ) 1547 ); 1494 $url = bp_loggedin_user_url( bp_members_get_path_chunks( array( bp_get_friends_slug(), 'add-friend', array( $friend_id ) ) ) ); 1548 1495 echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( $url, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; 1549 1496 } else {
Note: See TracChangeset
for help on using the changeset viewer.