Changeset 3468 for trunk/bp-activity/bp-activity-filters.php
- Timestamp:
- 11/21/2010 10:41:37 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-filters.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r3340 r3468 103 103 } 104 104 105 /** 106 * bp_activity_at_name_filter() 107 * 108 * Finds and links @-mentioned users in activity updates 109 * 110 * @package BuddyPress Activity 111 * 112 * @param string $content The activity content 113 */ 105 114 function bp_activity_at_name_filter( $content ) { 106 115 include_once( ABSPATH . WPINC . '/registration.php' ); 107 116 108 $pattern = '/[@]+([A-Za-z0-9-_\.]+)/'; 109 preg_match_all( $pattern, $content, $usernames ); 110 111 // Make sure there's only one instance of each username 112 if ( !$usernames = array_unique( $usernames[1] ) ) 113 return $content; 117 $usernames = bp_activity_find_mentions( $content ); 114 118 115 119 foreach( (array)$usernames as $username ) {
Note: See TracChangeset
for help on using the changeset viewer.