Changeset 4672 for trunk/includes/core/functions.php
- Timestamp:
- 12/31/2012 01:21:33 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/core/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/core/functions.php
r4579 r4672 282 282 } 283 283 284 /** Mentions ******************************************************************/ 285 284 286 /** 285 287 * Searches through the content to locate usernames, designated by an @ sign. … … 321 323 322 324 // Skip if username does not exist or user is not active 323 $user _id = username_exists($username );324 if ( empty( $user _id ) || bbp_is_user_inactive( $user_id) )325 $user = get_user_by( 'slug', $username ); 326 if ( empty( $user->ID ) || bbp_is_user_inactive( $user->ID ) ) 325 327 continue; 326 328 327 329 // Replace name in content 328 $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bbp_get_user_profile_url( $user _id ) . "' rel='nofollow' class='bbp-mention-link $username'>@$username</a>", $content );330 $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bbp_get_user_profile_url( $user->ID ) . "' rel='nofollow' class='bbp-mention-link {$username}'>@{$username}</a>", $content ); 329 331 } 330 332
Note: See TracChangeset
for help on using the changeset viewer.