Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/15/2023 08:16:46 AM (2 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-members/bp-members-functions.php

    r13433 r13436  
    145145 *
    146146 * @param integer $user_id  The user ID.
    147  * @param array   $action {
     147 * @param array   $path_chunks {
    148148 *     An array of arguments. Optional.
    149149 *
     
    178178     * Filters the domain for the passed user.
    179179     *
    180      * @since 1.0.1
    181      * @deprecated 12.0.0
    182      *
    183      * @param string $domain        Domain for the passed user.
    184      * @param int    $user_id       ID of the passed user.
    185      * @param string $user_nicename User nicename of the passed user.
    186      * @param string $user_login    User login of the passed user.
    187      */
    188     $url = apply_filters_deprecated( 'bp_core_get_user_domain', array( $url, $user_id, false, false ), '12.0.0', 'bp_members_get_user_url' );
    189 
    190     /**
    191      * Filters the domain for the passed user.
    192      *
    193180     * @since 12.0.0
    194181     *
     
    327314        }
    328315    }
    329 
    330     /**
    331      * Filters the username based on originally provided user ID.
    332      *
    333      * @since 1.0.1
    334      * @deprecated 12.0.0
    335      *
    336      * @param string $slug Username determined by user ID.
    337      */
    338     $slug = apply_filters_deprecated( 'bp_core_get_username', array( $slug ), '12.0.0', 'bp_members_get_user_slug' );
    339316
    340317    /**
     
    25472524    if ( $is_site_creation ) {
    25482525        if ( bp_is_active( 'blogs' ) ) {
    2549             $redirect_to = trailingslashit( bp_get_blogs_directory_permalink() . 'create' );
     2526            $url = bp_get_blogs_directory_url(
     2527                array(
     2528                    'create_single_item' => 1,
     2529                )
     2530            );
     2531
     2532            $redirect_to = trailingslashit( $url );
    25502533        } else {
    25512534            // Perform no redirect in this case.
Note: See TracChangeset for help on using the changeset viewer.