bp_activity_check_moderation_keys

Moderate the posted activity item, if it contains moderate keywords.

Description

bp_activity_check_moderation_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_moderation_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_moderation_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_moderation_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 moderation is built. 
  9. $moderate = bp_core_check_for_moderation( $activity->user_id, '', $activity->content, wp_error ); 
  10. if ( is_wp_error( $moderate ) ) { 
  11. $activity->errors = $moderate; 
  12.  
  13. // Backpat. 
  14. $activity->component = false;