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/screens/single/admin.php

    r11923 r13446  
    1414 */
    1515function groups_screen_group_admin() {
    16     if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) )
     16    if ( ! bp_is_groups_component() || ! bp_is_current_action( 'admin' ) ) {
    1717        return false;
     18    }
    1819
    19     if ( bp_action_variables() )
     20    if ( bp_action_variables() ) {
    2021        return false;
     22    }
    2123
    22     bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' );
     24    $redirect = bp_get_group_manage_url(
     25        groups_get_current_group(),
     26        bp_groups_get_path_chunks( array( 'edit-details' ), 'manage' )
     27    );
     28
     29    bp_core_redirect( $redirect );
    2330}
Note: See TracChangeset for help on using the changeset viewer.