Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/29/2024 12:29:00 AM (2 years ago)
Author:
imath
Message:

Add 2 new filterable functions to get register/activate root slugs

These 2 functions are used to set rewrite rules and permastructs for registration and activation pages.

Using the provided filters it is now possible to prepend a custom-slug/ to these generated rewrite rules and permastructs. This was the only missing thing to be able to prepend a custom-slug/ to all BP directory/specific page root slugs.

Props espellcaste, slaFFik, dcavins.

See #9063
Closes ​https://github.com/buddypress/buddypress/pull/364

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r13979 r14011  
    228228
    229229                // Set-up Extra permastructs for the register and activate pages.
    230                 $this->register_permastruct = bp_get_signup_slug() . '/%' . $this->rewrite_ids['member_register'] . '%';
    231                 $this->activate_permastruct = bp_get_activate_slug() . '/%' . $this->rewrite_ids['member_activate'] . '%';
     230                $this->register_permastruct = bp_get_signup_root_slug() . '/%' . $this->rewrite_ids['member_register'] . '%';
     231                $this->activate_permastruct = bp_get_activate_root_slug() . '/%' . $this->rewrite_ids['member_activate'] . '%';
    232232
    233233                // Init the User's ID to use to build the Nav for.
    … …  
    726726                        ),
    727727                        'member_activate'     => array(
    728                                 'regex' => bp_get_activate_slug() . '/?$',
     728                                'regex' => bp_get_activate_root_slug() . '/?$',
    729729                                'order' => 40,
    730730                                'query' => 'index.php?' . $this->rewrite_ids['member_activate'] . '=1',
    731731                        ),
    732732                        'member_activate_key' => array(
    733                                 'regex' => bp_get_activate_slug() . '/([^/]+)/?$',
     733                                'regex' => bp_get_activate_root_slug() . '/([^/]+)/?$',
    734734                                'order' => 30,
    735735                                'query' => 'index.php?' . $this->rewrite_ids['member_activate'] . '=1&' . $this->rewrite_ids['member_activate_key'] . '=$matches[1]',
    736736                        ),
    737737                        'member_register'     => array(
    738                                 'regex' => bp_get_signup_slug() . '/?$',
     738                                'regex' => bp_get_signup_root_slug() . '/?$',
    739739                                'order' => 20,
    740740                                'query' => 'index.php?' . $this->rewrite_ids['member_register'] . '=1',
Note: See TracChangeset for help on using the changeset viewer.