bp_activity_check_blacklist_keys

Mark the posted activity as spam, if it contains blacklist keywords.

Description

bp_activity_check_blacklist_keys( (BP_Activity_Activity) $activity ); 

Parameters (1)

0. $activity (BP_Activity_Activity)
The activity object to check.

Usage

  1. if ( !function_exists( 'bp_activity_check_blacklist_keys' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-filters.php'; 
  3.  
  4. // The activity object to check. 
  5. $activity = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_activity_check_blacklist_keys($activity); 
  9.  

Defined (1)

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

/bp-activity/bp-activity-filters.php  
  1. function bp_activity_check_blacklist_keys( $activity ) { 
  2.  
  3. // Only check specific types of activity updates. 
  4. if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) { 
  5. return; 
  6.  
  7. // Send back theerrorso activity update fails. 
  8. // @todo This is temporary until some kind of trash status is built. 
  9. $blacklist = bp_core_check_for_blacklist( $activity->user_id, '', $activity->content, wp_error ); 
  10. if ( is_wp_error( $blacklist ) ) { 
  11. $activity->errors = $blacklist; 
  12.  
  13. // Backpat. 
  14. $activity->component = false;