Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/15/2023 08:16:46 AM (13 months ago)
Author:
imath
Message:

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
notices.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r13433 r13436  
    11161116function bp_core_get_root_domain() {
    11171117    _deprecated_function( __FUNCTION__, '12.0.0', 'bp_rewrites_get_root_url()' );
    1118 
    11191118    $domain = bp_rewrites_get_root_url();
    11201119
     
    11451144    // have a valid URL.
    11461145    if ( empty( $location ) ) {
    1147         $location = bp_get_root_domain();
     1146        $location = bp_get_root_url();
    11481147    }
    11491148
     
    25302529
    25312530    if ( empty( $_POST['search-terms'] ) ) {
    2532         bp_core_redirect( bp_get_root_domain() );
     2531        bp_core_redirect( bp_get_root_url() );
    25332532        return;
    25342533    }
     
    25742573
    25752574        if ( empty( $slug ) && 'posts' != $search_which ) {
    2576             bp_core_redirect( bp_get_root_domain() );
     2575            bp_core_redirect( bp_get_root_url() );
    25772576            return;
    25782577        }
     
    43684367    } else {
    43694368        if ( bp_is_active( 'settings' ) ) {
    4370             $redirect_to = sprintf(
    4371                 '%s%s/notifications/',
    4372                 bp_members_get_user_url( $raw_user_id ),
    4373                 bp_get_settings_slug()
     4369            $redirect_to = bp_members_get_user_url(
     4370                $raw_user_id,
     4371                array(
     4372                    'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ),
     4373                    'single_item_action'    => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ),
     4374                )
    43744375            );
    43754376        } else {
Note: See TracChangeset for help on using the changeset viewer.