Changeset 9095
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-template.php
r8931 r9095 1499 1499 1500 1500 /** 1501 * Get a list of thread recipients or a "x recipients" string. 1502 * 1503 * In BuddyPress 2.2.0, this parts of this functionality were moved into the 1504 * members/single/messages/single.php template. This function is no longer used 1505 * by BuddyPress. 1506 * 1507 * @return string 1508 */ 1509 function bp_get_the_thread_recipients(){ 1510 if ( 5 <= bp_get_thread_recipients_count() ) { 1511 $recipients = sprintf( __( '%s recipients', 'buddypress' ), number_format_i18n( bp_get_thread_recipients_count() ) ); 1512 } else { 1513 $recipients = bp_get_thread_recipients_list(); 1514 } 1515 1516 return apply_filters( 'bp_get_the_thread_recipients', $recipients ); 1517 } 1518 1519 /** 1520 * Get the number of recipients in the current thread. 1521 * 1522 * @since BuddyPress (2.2.0) 1523 * 1524 * @return int 1525 */ 1526 function bp_get_thread_recipients_count() { 1527 global $thread_template; 1528 return count( $thread_template->thread->recipients ); 1529 } 1530 1531 /** 1501 1532 * Output HTML links to recipients in the current thread. 1502 */ 1503 function bp_the_thread_recipients() { 1504 echo bp_get_the_thread_recipients(); 1533 * 1534 * @since BuddyPress (2.2.0) 1535 */ 1536 function bp_the_thread_recipients_list() { 1537 echo bp_get_thread_recipients_list(); 1505 1538 } 1506 1539 /** 1507 1540 * Generate HTML links to the profiles of recipients in the current thread. 1508 1541 * 1509 * @return string 1510 */ 1511 function bp_get_the_thread_recipients() { 1542 * @since BuddyPress (2.2.0) 1543 * 1544 * @return string 1545 */ 1546 function bp_get_thread_recipients_list() { 1512 1547 global $thread_template; 1513 1548 1514 1549 $recipient_links = array(); 1515 1516 if ( count( $thread_template->thread->recipients ) >= 5 ) {1517 return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count( $thread_template->thread->recipients ) ) );1518 }1519 1550 1520 1551 foreach( (array) $thread_template->thread->recipients as $recipient ) { … … 1530 1561 } 1531 1562 1532 return apply_filters( 'bp_get_the_thread_recipients ', implode( ', ', $recipient_links ) );1563 return apply_filters( 'bp_get_the_thread_recipients_list', implode( ', ', $recipient_links ) ); 1533 1564 } 1534 1565 -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/messages/single.php
r9089 r9095 10 10 <span class="highlight"> 11 11 12 <?php if ( ! bp_get_the_thread_recipients() ) : ?>12 <?php if ( ! bp_get_thread_recipients_count() ) : ?> 13 13 14 14 <?php _e( 'You are alone in this conversation.', 'buddypress' ); ?> 15 15 16 <?php elseif ( 5 <= bp_get_thread_recipients_count() ) : ?> 17 18 <?php printf( __( 'Conversation between %s recipients.', 'buddypress' ), number_format_i18n( bp_get_thread_recipients_count() ) ); ?> 19 16 20 <?php else : ?> 17 21 18 <?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_th e_thread_recipients() ); ?>22 <?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_thread_recipients_list() ); ?> 19 23 20 24 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.