Warning: This function has been deprecated. bbp_make_clickable() instead.
bbp_find_mentions( string $content = '' )
Searches through the content to locate usernames, designated by an @ sign.
Description Description
Parameters Parameters
- $content
-
(Optional) The content
Default value: ''
Return Return
(bool|array) $usernames Existing usernames. False if no matches.
Source Source
File: includes/core/functions.php
function bbp_find_mentions( $content = '' ) {
$pattern = bbp_find_mentions_pattern();
preg_match_all( $pattern, $content, $usernames );
$usernames = array_unique( array_filter( $usernames[1] ) );
// Bail if no usernames
if ( empty( $usernames ) ) {
$usernames = false;
}
// Filter & return
return apply_filters( 'bbp_find_mentions', $usernames, $pattern, $content );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | bbp_make_clickable() |
| 2.2.0 | Introduced. |