Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/08/2023 06:31:46 AM (19 months ago)
Author:
imath
Message:

Make sure all Groups component URLs are built using BP rewrites API

  • Introduce the bp_groups_get_create_url() to ease Groups create URLs generation.
  • Improve bp_groups_get_path_chunks() to deal with front-end group admin URLs and the Groups create URLs.
  • Deprecate bp_get_groups_directory_permalink() in favor of bp_get_groups_directory_url().
  • Replace all remaining deprecated functions usage.
  • Start putting deprecated functions behind a function_exists( 'bp_classic' ) check, corresponding functions were added inside the BP Classic backcompat plugin.
  • Adjust some Groups routing unit tests.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

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

    r13437 r13449  
    637637
    638638    // Construct URL for form.
    639     $form_url = remove_query_arg( array( 'action', 'deleted', 'no_admins', 'error', 'error_new', 'success_new', 'error_modified', 'success_modified' ), $_SERVER['REQUEST_URI'] );
    640     $form_url = add_query_arg( 'action', 'save', $form_url );
    641     $create_url = bp_get_groups_directory_url(
    642         array(
    643             'create_single_item' => 1,
    644         )
    645     );
     639    $form_url   = remove_query_arg( array( 'action', 'deleted', 'no_admins', 'error', 'error_new', 'success_new', 'error_modified', 'success_modified' ), $_SERVER['REQUEST_URI'] );
     640    $form_url   = add_query_arg( 'action', 'save', $form_url );
     641    $create_url = bp_groups_get_create_url();
    646642
    647643    /**
     
    819815    // Prepare the group items for display.
    820816    $bp_groups_list_table->prepare_items();
    821     $create_url = bp_get_groups_directory_url(
    822         array(
    823             'create_single_item' => 1,
    824         )
    825     );
     817    $create_url = bp_groups_get_create_url();
    826818
    827819    /**
Note: See TracChangeset for help on using the changeset viewer.