Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/15/2023 08:16:46 AM (4 years 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-filters.php

    r13433 r13436  
    384384         * @param string $value URL to redirect to.
    385385         */
    386         return apply_filters( 'bp_core_login_redirect_to', bp_get_root_domain() );
     386        return apply_filters( 'bp_core_login_redirect_to', bp_get_root_url() );
    387387}
    388388add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
    … …  
    12061206function bp_email_set_default_tokens( $tokens, $property_name, $transform, $email ) {
    12071207        $tokens['site.admin-email'] = bp_get_option( 'admin_email' );
    1208         $tokens['site.url']         = bp_get_root_domain();
     1208        $tokens['site.url']         = bp_get_root_url();
    12091209        $tokens['email.subject']    = $email->get_subject();
    12101210
    … …  
    12361236
    12371237                        if ( bp_is_active( 'settings' ) && empty( $tokens['unsubscribe'] ) ) {
    1238                                 $tokens['unsubscribe'] = esc_url( sprintf(
    1239                                         '%s%s/notifications/',
    1240                                         bp_members_get_user_url( $user_obj->ID ),
    1241                                         bp_get_settings_slug()
    1242                                 ) );
     1238                                $tokens['unsubscribe'] = esc_url(
     1239                                        bp_members_get_user_url(
     1240                                                $user_obj->ID,
     1241                                                array(
     1242                                                        'single_item_component' => bp_rewrites_get_slug( 'members', 'member_settings', bp_get_settings_slug() ),
     1243                                                        'single_item_action'    => bp_rewrites_get_slug( 'members', 'member_settings_notifications', 'notifications' ),
     1244                                                )
     1245                                        )
     1246                                );
    12431247                        }
    12441248                }
Note: See TracChangeset for help on using the changeset viewer.