bbp_find_mentions_pattern

Set the pattern used for matching usernames for mentions.

Description

(string) bbp_find_mentions_pattern(); 

Moved into its own function to allow filtering of the regex pattern anywhere mentions might be used.

Returns (string)

Pattern to match usernames with


Usage

  1. if ( !function_exists( 'bbp_find_mentions_pattern' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/core/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_find_mentions_pattern(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/core/functions.php  
  1. function bbp_find_mentions_pattern() { 
  2. return apply_filters( 'bbp_find_mentions_pattern', '/[@]+([A-Za-z0-9-_\.@]+)\b/' );