Changeset 4621
- Timestamp:
- 07/06/2011 07:35:51 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r4611 r4621 113 113 * 114 114 * @package BuddyPress Activity 115 * @param $action The type of activity item. Just 'new_at_mention' for now 116 * @param $item_id The activity id 117 * @param $secondary_item_id In the case of at-mentions, this is the mentioner's id 118 * @param $total_items The total number of notifications to format 119 */ 120 function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items ) { 115 * @param str $action The type of activity item. Just 'new_at_mention' for now 116 * @param int $item_id The activity id 117 * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's id 118 * @param int $total_items The total number of notifications to format 119 * @param str $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise 120 */ 121 function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { 121 122 global $bp; 122 123 … … 129 130 130 131 if ( (int)$total_items > 1 ) { 131 return apply_filters( 'bp_activity_multiple_at_mentions_notification', '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int)$total_items ) . '</a>', $at_mention_link, $total_items, $activity_id, $poster_user_id ); 132 $text = sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int)$total_items ); 133 $filter = 'bp_activity_multiple_at_mentions_notification'; 132 134 } else { 133 135 $user_fullname = bp_core_get_user_displayname( $poster_user_id ); 134 135 return apply_filters( 'bp_activity_single_at_mentions_notification', '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . sprintf( __( '%1$s mentioned you in an activity update', 'buddypress' ), $user_fullname ) . '</a>', $at_mention_link, $total_items, $activity_id, $poster_user_id );136 $text = sprintf( __( '%1$s mentioned you in an activity update', 'buddypress' ), $user_fullname ); 137 $filter = 'bp_activity_single_at_mentions_notification'; 136 138 } 137 139 break; 138 140 } 141 142 if ( 'string' == $format ) { 143 $return = apply_filters( $filter, '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . $text . '</a>', $at_mention_link, (int)$total_items, $activity_id, $poster_user_id ); 144 } else { 145 $return = apply_filters( $filter, array( 146 'text' => $text, 147 'link' => $at_mention_link 148 ), $at_mention_link, (int)$total_items, $activity_id, $poster_user_id ); 149 } 139 150 140 151 do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items ); 141 152 142 return false;153 return $return; 143 154 } 144 155 -
trunk/bp-activity/bp-activity-loader.php
r4381 r4621 76 76 'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG, 77 77 'search_string' => __( 'Search Activity...', 'buddypress' ), 78 'global_tables' => $global_tables 78 'global_tables' => $global_tables, 79 'notification_callback' => 'bp_activity_format_notifications', 79 80 ); 80 81 -
trunk/bp-members/bp-members-notifications.php
r4620 r4621 57 57 if ( empty( $grouped_notifications ) ) 58 58 return false; 59 60 // Calculate d a renderable outcomefor each notification type59 60 // Calculate a renderable output for each notification type 61 61 foreach ( (array)$grouped_notifications as $component_name => $action_arrays ) { 62 62 if ( !$action_arrays )
Note: See TracChangeset
for help on using the changeset viewer.