Skip to:
Content

BuddyPress.org

Changeset 7486


Ignore:
Timestamp:
10/31/2013 11:09:49 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Update bp_get_send_public_message_link() to use bp_get_displayed_user_username() rather than bp_core_get_username(). Also add a bp_is_user() check so that false is properly returned when there is no displayed user, and removes $bp global touch.

Avoids possible debug notice if function is used out of context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r7467 r7486  
    27032703     * @since BuddyPress (1.2)
    27042704     *
    2705      * @global object $bp BuddyPress global settings
     2705     * @uses is_user_logged_in()
    27062706     * @uses bp_is_my_profile()
    2707      * @uses is_user_logged_in()
     2707     * @uses bp_is_user()
    27082708     * @uses wp_nonce_url()
    27092709     * @uses bp_loggedin_user_domain()
     
    27152715     */
    27162716    function bp_get_send_public_message_link() {
    2717         global $bp;
    2718 
    2719         if ( bp_is_my_profile() || !is_user_logged_in() )
     2717
     2718        if ( ! is_user_logged_in() || ! bp_is_user() || bp_is_my_profile() )
    27202719            return false;
    27212720
    2722         return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_get_activity_directory_permalink() . '?r=' . bp_core_get_username( bp_displayed_user_id(), bp_get_displayed_user_username(), $bp->displayed_user->userdata->user_login ) ) );
     2721        return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_get_activity_directory_permalink() . '?r=' . bp_get_displayed_user_username() ) );
    27232722    }
    27242723
Note: See TracChangeset for help on using the changeset viewer.