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/bp-members-template.php

    r13897 r14011  
    244244
    245245/**
     246 * Returns the registration page root slug.
     247 *
     248 * This function is used to set the BP Signup rewrite rule and permastruct.
     249 *
     250 * @since 15.0.0
     251 *
     252 * @return string The registration page root slug.
     253 */
     254function bp_get_signup_root_slug() {
     255        /**
     256         * Filter here to edit the registration page root slug.
     257         *
     258         * @since 15.0.0
     259         *
     260         * @param string $register_root_slug The registration page root slug.
     261         */
     262        return apply_filters( 'bp_members_register_root_slug', bp_get_signup_slug() );
     263}
     264
     265/**
    246266 * Output the activation slug.
    247267 *
    … …  
    275295                return apply_filters( 'bp_get_activate_slug', $slug );
    276296        }
     297
     298/**
     299 * Returns the registration page root slug.
     300 *
     301 * This function is used to set the BP Signup rewrite rule and permastruct.
     302 *
     303 * @since 15.0.0
     304 *
     305 * @return string The registration page root slug.
     306 */
     307function bp_get_activate_root_slug() {
     308        /**
     309         * Filter here to edit the activation page root slug.
     310         *
     311         * @since 15.0.0
     312         *
     313         * @param string $activate_root_slug The activation page root slug.
     314         */
     315        return apply_filters( 'bp_members_activate_root_slug', bp_get_activate_slug() );
     316}
    277317
    278318/**
Note: See TracChangeset for help on using the changeset viewer.