Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/06/2017 05:46:09 PM (8 years ago)
Author:
dcavins
Message:

Improve message recipient list string handling.

WordPress 2.5 introduced wp_sprintf_l() which is built to concatenate
arrays into natural language lists (and is meant to be translation
friendly). This commit uses that function to build the recipient list
text for single messages, like “Conversation between Three, Four, Two,
and you.”

Props Offereins.

See #7096.

File:
1 edited

Legend:

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

    r11449 r11576  
    16351635
    16361636                $recipient_links[] = $recipient_link;
     1637            } else {
     1638                $recipient_links[] = __( 'you', 'buddypress' );
    16371639            }
    16381640        }
    16391641
     1642        // Concatenate to natural language string.
     1643        $recipient_links = wp_sprintf_l( '%l', $recipient_links );
     1644
    16401645        /**
    16411646         * Filters the HTML links to the profiles of recipients in the current thread.
     
    16451650         * @param string $value Comma-separated list of recipient HTML links for current thread.
    16461651         */
    1647         return apply_filters( 'bp_get_the_thread_recipients_list', implode( ', ', $recipient_links ) );
     1652        return apply_filters( 'bp_get_the_thread_recipients_list', $recipient_links );
    16481653    }
    16491654
Note: See TracChangeset for help on using the changeset viewer.