bp_forums_strip_mentions_on_post_edit

Remove the anchor tag autogenerated for at-mentions when forum topics and posts are edited.

Description

(string) bp_forums_strip_mentions_on_post_edit( (string) $content ); 

Prevents embedded anchor tags.

Returns (string)

$content Sanitized post content.

Parameters (1)

0. $content (string)
Edited post content.

Usage

  1. if ( !function_exists( 'bp_forums_strip_mentions_on_post_edit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-filters.php'; 
  3.  
  4. // Edited post content. 
  5. $content = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_strip_mentions_on_post_edit($content); 
  9.  

Defined (1)

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

/bp-forums/bp-forums-filters.php  
  1. function bp_forums_strip_mentions_on_post_edit( $content ) { 
  2. $content = htmlspecialchars_decode( $content ); 
  3. $pattern = "|<a href='{$directory}[A-Za-z0-9-_\.]+/' rel='nofollow'>(@[A-Za-z0-9-_\.@]+)</a>|"; 
  4. $content = preg_replace( $pattern, "$1", $content ); 
  5.  
  6. return $content;