Changeset 7397 for trunk/bp-activity/bp-activity-filters.php
- Timestamp:
- 10/08/2013 08:57:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r7228 r7397 2 2 3 3 /** 4 * The Activity filters4 * Filters related to the Activity component. 5 5 * 6 6 * @package BuddyPress … … 79 79 add_filter( 'bp_activity_primary_link_before_save', 'esc_url_raw' ); 80 80 81 // Apply BuddyPress 81 // Apply BuddyPress-defined filters 82 82 add_filter( 'bp_get_activity_content', 'bp_activity_make_nofollow_filter' ); 83 83 add_filter( 'bp_get_activity_content_body', 'bp_activity_make_nofollow_filter' ); … … 109 109 110 110 /** 111 * Types of activity stream items to check against111 * Types of activity stream items to moderate. 112 112 * 113 113 * @since BuddyPress (1.6) 114 * 115 * @return array $types List of the activity types to moderate. 114 116 */ 115 117 function bp_activity_get_moderated_activity_types() { … … 122 124 123 125 /** 124 * Check activity stream for moderation keys126 * Moderate the posted activity item, if it contains moderate keywords. 125 127 * 126 128 * @since BuddyPress (1.6) 127 * @param BP_Activity_Activity $activity 129 * 130 * @param BP_Activity_Activity $activity The activity object to check. 128 131 */ 129 132 function bp_activity_check_moderation_keys( $activity ) { … … 140 143 141 144 /** 142 * Check activity stream for blacklisted keys145 * Mark the posted activity as spam, if it contains blacklist keywords. 143 146 * 144 147 * @since BuddyPress (1.6) 145 * @param BP_Activity_Activity $activity 148 * 149 * @param BP_Activity_Activity $activity The activity object to check. 146 150 */ 147 151 function bp_activity_check_blacklist_keys( $activity ) { … … 157 161 158 162 /** 159 * Custom kses filtering for activity content 163 * Custom kses filtering for activity content. 160 164 * 161 165 * @since BuddyPress (1.1) 162 *163 * @param string $content The activity content164 166 * 165 167 * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook. 166 168 * @uses wp_kses() 167 169 * 168 * @return string $content Filtered activity content 170 * @param string $content The activity content. 171 * @return string $content Filtered activity content. 169 172 */ 170 173 function bp_activity_filter_kses( $content ) { … … 197 200 * @since BuddyPress (1.2) 198 201 * 202 * @uses bp_activity_find_mentions() 203 * @uses bp_core_get_user_domain() 204 * 199 205 * @param string $content The contents of a given item. 200 206 * @param int $activity_id The activity id. Deprecated. 201 * 202 * @uses bp_activity_find_mentions() 203 * @uses bp_core_get_user_domain() 204 * 205 * @return string $content Content filtered for mentions 207 * @return string $content Content filtered for mentions. 206 208 */ 207 209 function bp_activity_at_name_filter( $content, $activity_id = 0 ) { … … 229 231 230 232 /** 231 * Catch mentions in a ctivity items before they aresaved into the database.233 * Catch mentions in an activity item before it is saved into the database. 232 234 * 233 235 * If mentions are found, replace @mention text with user links and add our 234 * hook to send mention s after the activity item is saved.236 * hook to send mention notifications after the activity item is saved. 235 237 * 236 238 * @since BuddyPress (1.5) 237 239 * 240 * @uses bp_activity_find_mentions() 241 * 238 242 * @param BP_Activity_Activity $activity 239 *240 * @uses bp_activity_find_mentions()241 243 */ 242 244 function bp_activity_at_name_filter_updates( $activity ) { … … 269 271 270 272 /** 271 * Sends emails and BP notifications for @-mentioned users in the contents of 272 * an activity item. 273 * Sends emails and BP notifications for users @-mentioned in an activity item. 273 274 * 274 275 * @since BuddyPress (1.7) 275 *276 * @param BP_Activity_Activity $activity The BP_Activity_Activity object277 276 * 278 277 * @uses bp_activity_at_message_notification() 279 278 * @uses bp_activity_update_mention_count_for_user() 279 * 280 * @param BP_Activity_Activity $activity The BP_Activity_Activity object 280 281 */ 281 282 function bp_activity_at_name_send_emails( $activity ) { … … 308 309 309 310 /** 310 * Catch es links in activity text so rel=nofollow can be added311 * Catch links in activity text so rel=nofollow can be added. 311 312 * 312 313 * @since BuddyPress (1.2) 313 314 * 314 * @param string $text Activity text 315 * 316 * @return string $text Text with rel=nofollow added to any links 315 * @param string $text Activity text. 316 * @return string $text Text with rel=nofollow added to any links. 317 317 */ 318 318 function bp_activity_make_nofollow_filter( $text ) { … … 321 321 322 322 /** 323 * Add s rel=nofollow to a link323 * Add rel=nofollow to a link. 324 324 * 325 325 * @since BuddyPress (1.2) … … 327 327 * @param array $matches 328 328 * 329 * @param array $matches Items matched by preg_replace_callback() in bp_activity_make_nofollow_filter(). 329 330 * @return string $text Link with rel=nofollow added 330 331 */ … … 336 337 337 338 /** 338 * Truncate s long activity entries when viewed in activity streams339 * Truncate long activity entries when viewed in activity streams. 339 340 * 340 341 * @since BuddyPress (1.5) 341 342 * 342 * @param string $text The original activity entry text343 *344 343 * @uses bp_is_single_activity() 345 * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook 346 * @uses apply_filters() To call the 'bp_activity_excerpt_length' hook 344 * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook. 345 * @uses apply_filters() To call the 'bp_activity_excerpt_length' hook. 347 346 * @uses bp_create_excerpt() 348 347 * @uses bp_get_activity_id() 349 348 * @uses bp_get_activity_thread_permalink() 350 * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook 351 * 352 * @return string $excerpt The truncated text 349 * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook. 350 * 351 * @param string $text The original activity entry text. 352 * @return string $excerpt The truncated text. 353 353 */ 354 354 function bp_activity_truncate_entry( $text ) {
Note: See TracChangeset
for help on using the changeset viewer.