Changeset 5109 for trunk/bp-activity/bp-activity-filters.php
- Timestamp:
- 09/06/2011 12:30:01 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-filters.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r4989 r5109 1 1 <?php 2 3 /** 4 * The Activity filters 5 * 6 * @package BuddyPress 7 * @subpackage ActivityFilters 8 */ 9 2 10 // Exit if accessed directly 3 11 if ( !defined( 'ABSPATH' ) ) exit; … … 80 88 add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' ); 81 89 90 /** 91 * Custom kses filtering for activity content 92 * 93 * @since 1.1.0 94 * 95 * @param string $content The activity content 96 * 97 * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook. 98 * @uses wp_kses() 99 * 100 * @return string $content Filtered activity content 101 */ 82 102 function bp_activity_filter_kses( $content ) { 83 103 global $allowedtags; … … 110 130 * Finds and links @-mentioned users in the contents of activity items 111 131 * 112 * @ package BuddyPress Activity132 * @since 1.2.0 113 133 * 114 134 * @param string $content The activity content 115 * @param int $activity_id When $adjust_mention_count is true, you must provide an $activity_id, 116 * which will be added to the list of the user's unread mentions 135 * @param int $activity_id The activity id 136 * 137 * @uses bp_activity_find_mentions() 138 * @uses bp_is_username_compatibility_mode() 139 * @uses bp_core_get_userid_from_nicename() 140 * @uses bp_activity_at_message_notification() 141 * @uses bp_core_get_user_domain() 142 * @uses bp_activity_adjust_mention_count() 143 * 144 * @return string $content Content filtered for mentions 117 145 */ 118 146 function bp_activity_at_name_filter( $content, $activity_id = 0 ) { … … 146 174 * Catch mentions in saved activity items 147 175 * 148 * @package BuddyPress 149 * @since 1.5 176 * @since 1.5.0 150 177 * 151 178 * @param obj $activity 179 * 180 * @uses remove_filter() To remove the 'bp_activity_at_name_filter_updates' hook. 181 * @uses bp_activity_at_name_filter() 182 * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity} 152 183 */ 153 184 function bp_activity_at_name_filter_updates( $activity ) { … … 163 194 add_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' ); 164 195 196 /** 197 * Catches links in activity text so rel=nofollow can be added 198 * 199 * @since 1.2.0 200 * 201 * @param string $text Activity text 202 * 203 * @return string $text Text with rel=nofollow added to any links 204 */ 165 205 function bp_activity_make_nofollow_filter( $text ) { 166 206 return preg_replace_callback( '|<a (.+?)>|i', 'bp_activity_make_nofollow_filter_callback', $text ); 167 207 } 208 209 /** 210 * Adds rel=nofollow to a link 211 * 212 * @since 1.2.0 213 * 214 * @param array $matches 215 * 216 * @return string $text Link with rel=nofollow added 217 */ 168 218 function bp_activity_make_nofollow_filter_callback( $matches ) { 169 219 $text = $matches[1]; … … 175 225 * Truncates long activity entries when viewed in activity streams 176 226 * 177 * @ package BuddyPress Activity178 * @since 1.5227 * @since 1.5.0 228 * 179 229 * @param $text The original activity entry text 180 * @return $excerpt The truncated text 230 * 231 * @uses bp_is_single_activity() 232 * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook 233 * @uses apply_filters() To call the 'bp_activity_excerpt_length' hook 234 * @uses bp_create_excerpt() 235 * @uses bp_get_activity_id() 236 * @uses bp_get_activity_thread_permalink() 237 * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook 238 * 239 * @return string $excerpt The truncated text 181 240 */ 182 241 function bp_activity_truncate_entry( $text ) { … … 206 265 add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); 207 266 add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 ); 267 208 268 ?>
Note: See TracChangeset
for help on using the changeset viewer.