Skip to:

03/15/2023 08:16:46 AM (13 months ago)

Make more BuddyPress generated links ready for BP Rewrites

  • Improve the Members component adding permastructs and custom rewrite

rules for registration and activation pages.

  • Improve the Blogs component adding custom rewrite rule to handle the

Blogs create page.

  • Make a huge progress about replacing all occurrences of

bp_get_root_domain() (45 replacements were performed).

  • Deprecate bp_groups_directory_permalink(),

bp_get_groups_directory_permalink(), bp_blogs_directory_permalink() &
bp_get_blogs_directory_permalink() and replace them with these new
functions: bp_groups_directory_url(), bp_get_groups_directory_url(),
bp_blogs_directory_url() & bp_get_blogs_directory_url().

  • Although bp_loggedin_user_domain() & bp_displayed_user_domain()

should also be deprecated, we're leaving them as aliases of the right
functions to use. Plugin authors shouldn't use them to build other links
than member's profile home url.

NB: these deprecations are required because these functions were used
to build BuddyPress URLs concatenating URL chunks. Once the BP Classic
plugin will be built we will adapt the code to remove these deprecation

Props r-a-y, johnjamesjacoby, boonebgorges

See #4954

1 edited


  • trunk/src/bp-core/bp-core-catchuri.php

    r13433 r13436  
    632632 *                            logging in. Default: the URL originally requested.
    633633 *     @type string $root     The root URL of the site, used in case of error or mode 1 redirects.
    634  *                            Default: the value of {@link bp_get_root_domain()}.
     634 *                            Default: the value of {@link bp_get_root_url()}.
    635635 *     @type string $message  An error message to display to the user on the log-in page.
    636636 *                            Default: "You must log in to access the page you requested."
    647647        'mode'     => 2,                    // 1 = $root, 2 = wp-login.php.
    648648        'redirect' => $redirect_url,        // the URL you get redirected to when a user successfully logs in.
    649         'root'     => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access.
     649        'root'     => bp_get_root_url(),    // the landing page you get redirected to when a user doesn't have access.
    650650        'message'  => __( 'You must log in to access the page you requested.', 'buddypress' )
    651651    );
    908908         */
    909909        if ( false !== $front_page_component && bp_is_current_component( $front_page_component ) && ! bp_current_action() && ! bp_get_current_member_type() ) {
    910             $bp->canonical_stack['canonical_url'] = trailingslashit( bp_get_root_domain() );
     910            $bp->canonical_stack['canonical_url'] = bp_get_root_url();
    912912        // Except when the front page is set to the registration page
Note: See TracChangeset for help on using the changeset viewer.