Changeset 3474
- Timestamp:
- 11/22/2010 12:17:43 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-filters.php
r3300 r3474 111 111 add_filter( 'bp_page_title', 'bp_forums_add_forum_topic_to_page_title' ); 112 112 113 /** 114 * bp_forums_strip_mentions_on_post_edit( $title ) 115 * 116 * Removes the anchor tag autogenerated for at-mentions when forum topics and posts are edited. 117 * Prevents embedded anchor tags. 118 * 119 * @global object $bp 120 * @param string $content 121 * @return string $content 122 */ 123 function bp_forums_strip_mentions_on_post_edit( $content ) { 124 global $bp; 125 126 $content = htmlspecialchars_decode( $content ); 127 128 $pattern = "|<a href='" . $bp->root_domain . "/" . $bp->members->slug . "/[A-Za-z0-9-_\.]+/' rel='nofollow'>(@[A-Za-z0-9-_\.]+)</a>|"; 129 130 $content = preg_replace( $pattern, "$1", $content ); 131 132 return $content; 133 } 134 add_filter( 'bp_get_the_topic_post_edit_text', 'bp_forums_strip_mentions_on_post_edit' ); 135 add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' ); 136 113 137 ?>
Note: See TracChangeset
for help on using the changeset viewer.