Skip to:
Content

BuddyPress.org

Changeset 9830


Ignore:
Timestamp:
05/02/2015 01:36:28 AM (4 years ago)
Author:
boonebgorges
Message:

Introduce bp_get_max_thread_recipients_to_list().

This wrapper function makes it possible to filter the number of recipients on
a message thread beyond which the 'Conversation between...' gloss goes from
listing the recipients' names to simply saying "x recipients".

Props henry.wright.
Fixes #6150.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-template.php

    r9819 r9830  
    20812081
    20822082/**
     2083 * Get the max number of recipients to list in the 'Conversation between...' gloss.
     2084 *
     2085 * @since BuddyPress (2.3.0)
     2086 *
     2087 * @return int
     2088 */
     2089function bp_get_max_thread_recipients_to_list() {
     2090    /**
     2091     * Filters the max number of recipients to list in the 'Conversation between...' gloss.
     2092     *
     2093     * @since BuddyPress (2.3.0)
     2094     *
     2095     * @param int $count Recipient count. Default: 5.
     2096     */
     2097    return (int) apply_filters( 'bp_get_max_thread_recipients_to_list', 5 );
     2098}
     2099
     2100/**
    20832101 * Output HTML links to recipients in the current thread.
    20842102 *
  • trunk/src/bp-templates/bp-legacy/buddypress/members/single/messages/single.php

    r9819 r9830  
    2121                    <?php _e( 'You are alone in this conversation.', 'buddypress' ); ?>
    2222
    23                 <?php elseif ( 5 <= bp_get_thread_recipients_count() ) : ?>
     23                <?php elseif ( bp_get_max_thread_recipients_to_list() <= bp_get_thread_recipients_count() ) : ?>
    2424
    2525                    <?php printf( __( 'Conversation between %s recipients.', 'buddypress' ), number_format_i18n( bp_get_thread_recipients_count() ) ); ?>
Note: See TracChangeset for help on using the changeset viewer.