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/deprecated/12.0.php

    r13433 r13436  
    242242    return apply_filters_deprecated( 'bp_core_get_user_domain', array( $domain, $user_id, $user_nicename, $user_login), '12.0.0', 'bp_members_get_user_url' );
    243243}
     244
     245/**
     246 * Get the link for the logged-in user's profile.
     247 *
     248 * @since 1.0.0
     249 * @deprecated 12.0.0
     250 *
     251 * @return string
     252 */
     253function bp_get_loggedin_user_link() {
     254    _deprecated_function( __FUNCTION__, '12.0.0', 'bp_loggedin_user_url()' );
     255    $url = bp_loggedin_user_url();
     256
     257    /**
     258     * Filters the link for the logged-in user's profile.
     259     *
     260     * @since 1.2.4
     261     * @deprecated 12.0.0
     262     *
     263     * @param string $url Link for the logged-in user's profile.
     264     */
     265    return apply_filters_deprecated( 'bp_get_loggedin_user_link', array( $url ), '12.0.0', 'bp_loggedin_user_url' );
     266}
     267
     268/**
     269 * Get the link for the displayed user's profile.
     270 *
     271 * @since 1.0.0
     272 * @deprecated 12.0.0
     273 *
     274 * @return string
     275 */
     276function bp_get_displayed_user_link() {
     277    _deprecated_function( __FUNCTION__, '12.0.0', 'bp_displayed_user_url()' );
     278    $url = bp_displayed_user_url();
     279
     280    /**
     281     * Filters the link for the displayed user's profile.
     282     *
     283     * @since 1.2.4
     284     * @deprecated 12.0.0
     285     *
     286     * @param string $url Link for the displayed user's profile.
     287     */
     288    return apply_filters_deprecated( 'bp_get_displayed_user_link', array( $url ), '12.0.0', 'bp_displayed_user_url' );
     289}
     290
     291/**
     292 * Alias of {@link bp_displayed_user_domain()}.
     293 *
     294 * @deprecated 12.0.0
     295 */
     296function bp_user_link() {
     297    _deprecated_function( __FUNCTION__, '12.0.0', 'bp_displayed_user_url()' );
     298    bp_displayed_user_url();
     299}
     300
     301/**
     302 * Output blog directory permalink.
     303 *
     304 * @since 1.5.0
     305 * @deprecated 12.0.0
     306 */
     307function bp_blogs_directory_permalink() {
     308    _deprecated_function( __FUNCTION__, '12.0.0', 'bp_blogs_directory_url()' );
     309    bp_blogs_directory_url();
     310}
     311
     312/**
     313 * Return blog directory permalink.
     314 *
     315 * @since 1.5.0
     316 * @deprecated 12.0.0
     317 *
     318 * @return string The URL of the Blogs directory.
     319 */
     320function bp_get_blogs_directory_permalink() {
     321    _deprecated_function( __FUNCTION__, '12.0.0', 'bp_get_blogs_directory_url()' );
     322    $url = bp_get_blogs_directory_url();
     323
     324    /**
     325     * Filters the blog directory permalink.
     326     *
     327     * @since 1.5.0
     328     * @deprecated 12.0.0
     329     *
     330     * @param string $url Permalink URL for the blog directory.
     331     */
     332    return apply_filters_deprecated( 'bp_get_blogs_directory_permalink', array( $url ), '12.0.0', 'bp_get_blogs_directory_url' );
     333}
Note: See TracChangeset for help on using the changeset viewer.