bp_activity_check_moderation_keys( BP_Activity_Activity $activity )
Moderate the posted activity item, if it contains moderate keywords.
Description
Parameters
- $activity
-
(Required) The activity object to check.
Source
File: bp-activity/bp-activity-filters.php
function bp_activity_check_moderation_keys( $activity ) { // Only check specific types of activity updates. if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) { return; } // Send back the error so activity update fails. // @todo This is temporary until some kind of moderation is built. $moderate = bp_core_check_for_moderation( $activity->user_id, '', $activity->content, 'wp_error' ); if ( is_wp_error( $moderate ) ) { $activity->errors = $moderate; // Backpat. $activity->component = false; } }
Changelog
Version | Description |
---|---|
BuddyPress 1.6.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.