Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/23/2023 07:35:38 PM (18 months ago)
Author:
imath
Message:

Make BP_Core_Nav generate "BP Rewrites ready" navigation links

  • Remove all components $parent_url attributes when setting sub nav items.
  • Only use the bp_core_create_nav_link() $link attribute argument & the bp_core_create_subnav_link() $parent_url attribute argument if specified to preserve backward compatibility.
  • Migrates the Community search feature so that it uses BP Rewrites.
  • Perform some bp_loggedin_user_domain() in favor of bp_loggedin_user_url().
  • Update some PHPUnit tests.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/screens/single/admin/delete-group.php

    r11923 r13441  
    1515function groups_screen_group_admin_delete_group() {
    1616
    17     if ( 'delete-group' != bp_get_group_current_admin_tab() )
     17    if ( 'delete-group' != bp_get_group_current_admin_tab() ) {
    1818        return false;
     19    }
    1920
    20     if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) )
     21    if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) ) {
    2122        return false;
     23    }
    2224
    2325    $bp = buddypress();
    2426
    2527    if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
     28        $groups_slug = bp_get_groups_slug();
     29        $redirect    = bp_loggedin_user_url(
     30            array(
     31                'single_item_component' => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ),
     32            )
     33        );
    2634
    2735        // Check the nonce first.
    28         if ( !check_admin_referer( 'groups_delete_group' ) ) {
     36        if ( ! check_admin_referer( 'groups_delete_group' ) ) {
    2937            return false;
    3038        }
     
    4048
    4149        // Group admin has deleted the group, now do it.
    42         if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
     50        if ( ! groups_delete_group( $bp->groups->current_group->id ) ) {
    4351            bp_core_add_message( __( 'There was an error deleting the group. Please try again.', 'buddypress' ), 'error' );
    4452        } else {
     
    5361             */
    5462            do_action( 'groups_group_deleted', $bp->groups->current_group->id );
    55 
    56             bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
    5763        }
    5864
    59         bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
     65        bp_core_redirect( $redirect );
    6066    }
    6167
Note: See TracChangeset for help on using the changeset viewer.