Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/04/2023 01:06:03 AM (2 years ago)
Author:
imath
Message:

Use the BP Rewrites API to generate single Groups item links

  • Introduce the bp_groups_get_path_chunks() function to build BP Rewrites arguments using a regular array.
  • Improve bp_members_get_path_chunks() so that it avoids looking for a custom slug when the chunk is a numeric value.
  • Introduce the bp_get_group_manage_url() function to build Group's front-end Admin URLs using BP Rewrites.
  • Deprecate bp_group_admin_permalink() & bp_get_group_admin_permalink() in favor of bp_group_manage_url() & bp_get_group_manage_url().
  • Replace all remaining usage of bp_get_group_permalink() in favor of bp_get_group_url() or bp_get_group_manage_url().

Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/81
See #4954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-notifications.php

    r13441 r13446  
    161161    }
    162162
    163     $group = groups_get_group( $group_id );
    164     $args  = array(
     163    $group       = groups_get_group( $group_id );
     164    $path_chunks = bp_groups_get_path_chunks( array( 'membership-requests' ), 'manage' );
     165    $args        = array(
    165166        'tokens' => array(
    166167            'admin.id'             => $admin_id,
     
    168169            'group.name'           => $group->name,
    169170            'group.id'             => $group_id,
    170             'group-requests.url'   => esc_url( bp_get_group_permalink( $group ) . 'admin/membership-requests' ),
     171            'group-requests.url'   => esc_url( bp_get_group_manage_url( $group, $path_chunks ) ),
    171172            'profile.url'          => esc_url( bp_members_get_user_url( $requesting_user_id ) ),
    172173            'requesting-user.id'   => $requesting_user_id,
Note: See TracChangeset for help on using the changeset viewer.