Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/08/2023 06:31:46 AM (16 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-functions.php

    r13446 r13449  
    40154015    }
    40164016
     4017    $key_action_variables = 'single_item_action_variables';
     4018    if ( 'create' === $context ) {
     4019        $path_chunks['create_single_item'] = 1;
     4020        $key_action_variables              = 'create_single_item_variables';
     4021
     4022        // Init create action variables with the `step` slug.
     4023        $path_chunks[ $key_action_variables ][] = bp_rewrites_get_slug( 'groups', 'bp_group_create_step', 'step' );
     4024    }
     4025
    40174026    if ( $chunks ) {
    40184027        foreach ( $chunks as $chunk ) {
    40194028            if ( is_numeric( $chunk ) ) {
    4020                 $path_chunks['single_item_action_variables'][] = $chunk;
     4029                $path_chunks[ $key_action_variables ][] = $chunk;
    40214030            } else {
    40224031                if ( isset( $group_screens[ $chunk ]['rewrite_id'] ) ) {
    4023                     $item_action_variable_rewrite_id               = $group_screens[ $chunk ]['rewrite_id'];
    4024                     $path_chunks['single_item_action_variables'][] = bp_rewrites_get_slug( 'groups', $item_action_variable_rewrite_id, $chunk );
     4032                    $item_action_variable_rewrite_id        = $group_screens[ $chunk ]['rewrite_id'];
     4033                    $path_chunks[ $key_action_variables ][] = bp_rewrites_get_slug( 'groups', $item_action_variable_rewrite_id, $chunk );
    40254034                } else {
    4026                     $path_chunks['single_item_action_variables'][] = $chunk;
     4035                    $path_chunks[ $key_action_variables ][] = $chunk;
    40274036                }
    40284037            }
Note: See TracChangeset for help on using the changeset viewer.