Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/01/2023 08:17:11 AM (3 years ago)
Author:
imath
Message:

BP Rewrites: introduce the bp_rewrites_get_url() function

Its role is to build every BuddyPress URL using the BP Rewrites API.

This commit also deprecates softly some key functions like bp_get_root_domain() to let us review (thanks to deprecated notices) all BuddyPress links during 12.0 development cycle and make them use the introduced bp_rewrites_get_url() function or a wrapper of it. Once all replacements achieved, we'll need to fully deprecate:

  • bp_get_root_domain()
  • bp_root_domain()
  • bp_core_get_root_domain()

Slug constants have also been completely deprecated as we will be able to customize every slugs from the future "URL" tab of the BuddyPress settings page.

The $bp->root_domain BuddyPress global has been deprecated in favor of $bp->root_url.

Finally, the Components $rewrite_ids properties are now in place and corresponding rewrite rules are successfully generated.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r13395 r13432  
    214214     */
    215215    function bp_get_signup_slug() {
    216         $bp = buddypress();
     216        $bp   = buddypress();
     217        $slug = 'register';
    217218
    218219        if ( ! empty( $bp->pages->register->slug ) ) {
    219220            $slug = $bp->pages->register->slug;
    220         } elseif ( defined( 'BP_REGISTER_SLUG' ) ) {
    221             $slug = BP_REGISTER_SLUG;
    222         } else {
    223             $slug = 'register';
    224221        }
    225222
     
    250247     */
    251248    function bp_get_activate_slug() {
    252         $bp = buddypress();
     249        $bp   = buddypress();
     250        $slug = 'activate';
    253251
    254252        if ( ! empty( $bp->pages->activate->slug ) ) {
    255253            $slug = $bp->pages->activate->slug;
    256         } elseif ( defined( 'BP_ACTIVATION_SLUG' ) ) {
    257             $slug = BP_ACTIVATION_SLUG;
    258         } else {
    259             $slug = 'activate';
    260254        }
    261255
Note: See TracChangeset for help on using the changeset viewer.