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-blogs/bp-blogs-filters.php

    r13405 r13436  
    3030 */
    3131function bp_blogs_creation_location( $url ) {
     32    $bp_url = bp_get_blogs_directory_url(
     33        array(
     34            'create_single_item' => 1,
     35        )
     36    );
    3237
    3338    /**
     
    3641     * @since 1.6.0
    3742     *
    38      * @param string $permalink URL for the 'Create a new site' signup page.
    39      * @param string $url       The original URL (points to wp-signup.php by default).
     43     * @param string $bp_url URL for the 'Create a new site' signup page.
     44     * @param string $url    The original URL (points to wp-signup.php by default).
    4045     */
    41     return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_blogs_directory_permalink() . 'create' ), $url );
     46    return apply_filters( 'bp_blogs_creation_location', $bp_url, $url );
    4247}
    4348add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
Note: See TracChangeset for help on using the changeset viewer.