Changeset 9208 for trunk/src/bp-messages/bp-messages-notifications.php
- Timestamp:
- 12/03/2014 03:27:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-notifications.php
r8947 r9208 129 129 if ( 'new_message' === $action ) { 130 130 if ( $total_items > 1 ) { 131 $amount = 'multiple'; 131 132 $text = sprintf( __( 'You have %d new messages', 'buddypress' ), $total_items ); 132 $filter = 'bp_messages_multiple_new_message_notification';133 133 } else { 134 $amount = 'single'; 135 134 136 // get message thread ID 135 137 $message = new BP_Messages_Message( $item_id ); … … 144 146 $text = sprintf( _n( 'You have %s new private message', 'You have %s new private messages', $total_items, 'buddypress' ), bp_core_number_format( $total_items ) ); 145 147 } 146 $filter = 'bp_messages_single_new_message_notification';147 148 } 148 149 } … … 154 155 $retval = esc_html( $text ); 155 156 } 156 $return = apply_filters( $filter, $retval, (int) $total_items, $text, $link, $item_id, $secondary_item_id ); 157 158 /** 159 * Filters the new message notification text before the notification is created. 160 * 161 * This is a dynamic filter. Possible filter names are: 162 * - 'bp_messages_multiple_new_message_notification' 163 * - 'bp_messages_single_new_message_notification' 164 * 165 * @param string $retval Notification text. 166 * @param int $total_items Number of messages referred to by the notification. 167 * @param string $text The raw notification test (ie, not wrappen in a link). 168 * @param int $item_id ID of the associated item. 169 * @param int $secondary_item_id ID of the secondary associated item. 170 */ 171 $return = apply_filters( 'bp_messages_' . $amount . '_new_message_notification', $retval, (int) $total_items, $text, $link, $item_id, $secondary_item_id ); 157 172 } else { 158 $return = apply_filters( $filter, array( 173 /** This filter is documented in bp-messages/bp-messages-notifications.php */ 174 $return = apply_filters( 'bp_messages_' . $amount . '_new_message_notification', array( 159 175 'text' => $text, 160 176 'link' => $link
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)