Skip to:
Content
Pages
Categories
Search
Top
Bottom

A little addition in order to match the current "mention" and "send private message" features.

  • Profile photo of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    @slaFFik
    Please consider to change the lines below of cd-avatar-bubble.php as following:

    
    [ Original ]
    if ( is_user_logged_in() ) {
    $mention .= '<strong><a>loggedin_user->id, false, false ) . BP_ACTIVITY_SLUG .'/?r='.bp_core_get_username( $ID, false, false ).'" title="'. __('Mention this user', 'cd_ab') .'">@'. bp_core_get_username( $ID, false, false ) .'</a></strong>';
    $message = '<a>loggedin_user->id, false, false ) . BP_MESSAGES_SLUG . '/compose/?r=' . bp_core_get_username( $ID, false, false ) .'" title="'. __('Send a private message to this user', 'cd_ab') .'">'. __('Private Message', 'cd_ab') .'</a>';
    

    =>

    [Changed to]

    // Added by chestnut_jp starts
    $bubble_nonce = ‘&_wpnonce=’ . wp_create_nonce();
    // Added by chestnut_jp ends
    // Changed by chestnut_jp starts
    $mention .= ‘loggedin_user->id, false, false ) . BP_ACTIVITY_SLUG .’/?r=’.bp_core_get_username( $ID, false, false ).$bubble_nonce.'” title=”‘. __(‘Mention this user’, ‘cd_ab’) .'”>@’. bp_core_get_username( $ID, false, false ) .’‘;
    $message = ‘loggedin_user->id, false, false ) . BP_MESSAGES_SLUG . ‘/compose/?r=’ . bp_core_get_username( $ID, false, false ) .$bubble_nonce.'” title=”‘. __(‘Send a private message to this user’, ‘cd_ab’) .'”>’. __(‘Private Message’, ‘cd_ab’) .’‘;
    // Changed by chestnut_jp ends

    Note: Please add “$bubble_nonce” right after “bp_core_get_username( $ID, false,false )” so that mention and private message send links become the same as thoese buttons on each user’s profile page.

    The wp_create_nonce() function accepts “action name” but it does not seem to be neccessary in this case.

  • The topic ‘A little addition in order to match the current "mention" and "send private message" features.’ is closed to new replies.
Skip to toolbar