Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/07/2023 04:28:08 AM (14 months ago)
Author:
imath
Message:

BP Rewrites: Introduce the bp_members_get_user_url() function

As many member URLs are built concatenating bp_core_get_user_domain()
with URL chunks, the safer way to make sure developers update the way they
build their member URLs in favor of using BP Rewrites is:

  1. to deprecate this function
  2. create a new function bp_members_get_user_url() which is a wrapper of

bp_rewrites_get_url()

  1. replace all bp_core_get_user_domain() occurrences by

bp_members_get_user_url()

This commit also deprecates bp_core_get_username() in favor of the new
bp_members_get_user_slug() function and updates PHPUnit tests.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-template.php

    r13409 r13433  
    338338        }
    339339
    340         $domain = bp_core_get_user_domain( $user_id );
     340        $domain = bp_members_get_user_url( $user_id );
    341341
    342342        /**
     
    383383        }
    384384
    385         $domain = bp_core_get_user_domain( $user_id );
     385        $domain = bp_members_get_user_url( $user_id );
    386386
    387387        /**
     
    435435        }
    436436
    437         $domain = bp_core_get_user_domain( $user_id );
     437        $domain = bp_members_get_user_url( $user_id );
    438438
    439439        // Base unread URL.
     
    497497        }
    498498
    499         $domain = bp_core_get_user_domain( $user_id );
     499        $domain = bp_members_get_user_url( $user_id );
    500500
    501501        // Base read URL.
     
    14841484         * @param string $value URL for the Private Message link in member profile headers.
    14851485         */
    1486         return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id() ) ) );
     1486        return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_members_get_user_slug( bp_displayed_user_id() ) ) );
    14871487    }
    14881488
Note: See TracChangeset for help on using the changeset viewer.