A little addition in order to match the current “mention” and “send private message” features.
-
@slaFFik
Please consider to change the lines below of cd-avatar-bubble.php as following:
`
[ Original ]
if ( is_user_logged_in() ) {
$mention .= ‘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 ) .’‘;
$message = ‘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’) .’‘;
`
=>
`
[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 endsNote: 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.
You must be logged in to reply to this topic.