diff --git src/bp-messages/bp-messages-cssjs.php src/bp-messages/bp-messages-cssjs.php
index 33cdf16..b4095ef 100644
|
|
|
function messages_autocomplete_init_jsblock() { |
| 68 | 68 | var users = document.getElementById('send-to-usernames').className; |
| 69 | 69 | document.getElementById('send-to-usernames').value = String(users); |
| 70 | 70 | }); |
| | 71 | |
| | 72 | /** |
| | 73 | * This part is a temporary fix to make sure the recipient added using PHP |
| | 74 | * is not a li nested in another li and is displayed like autocomplete results. |
| | 75 | * |
| | 76 | * The correct fix would be to put the <?php bp_message_get_recipient_tabs(); ?> |
| | 77 | * before the li in bp-templates/members/single/messages/compose.php |
| | 78 | * |
| | 79 | * @see https://buddypress.trac.wordpress.org/ticket/6935 |
| | 80 | */ |
| | 81 | var move = false; |
| | 82 | |
| | 83 | jQuery( 'ul.first.acfb-holder li' ).each( function( i, element ) { |
| | 84 | if ( jQuery( element ).hasClass( 'friend-tab' ) ) { |
| | 85 | move = jQuery( element ); |
| | 86 | } |
| | 87 | } ); |
| | 88 | |
| | 89 | if ( false !== move ) { |
| | 90 | jQuery( 'ul.first.acfb-holder li' ).first().html( jQuery( '#send-to-input' ) ).before( move ); |
| | 91 | } |
| 71 | 92 | }); |
| 72 | 93 | </script> |
| 73 | 94 | |
diff --git src/bp-messages/bp-messages-template.php src/bp-messages/bp-messages-template.php
index b5b7f8e..a765842 100644
|
|
|
function bp_message_get_recipient_tabs() { |
| 1380 | 1380 | if ( ! empty( $user_id ) ) : ?> |
| 1381 | 1381 | |
| 1382 | 1382 | <li id="un-<?php echo esc_attr( $recipient ); ?>" class="friend-tab"> |
| 1383 | | <span><?php |
| 1384 | | echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ); |
| 1385 | | echo bp_core_get_userlink( $user_id ); |
| 1386 | | ?></span> |
| | 1383 | <span> |
| | 1384 | <?php printf( '<a href="%1$s">%2$s %3$s</a>', |
| | 1385 | esc_url( bp_core_get_user_domain( $user_id ) ), |
| | 1386 | bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15, 'class' => '' ) ), |
| | 1387 | esc_html( bp_core_get_user_displayname( $user_id ) ) |
| | 1388 | ); ?> |
| | 1389 | </span> |
| 1387 | 1390 | </li> |
| 1388 | 1391 | |
| 1389 | 1392 | <?php endif; |