BBP_Akismet::filter_post_terms( string $terms = '', int $topic_id, int $reply_id )
Handle any terms submitted with a post flagged as spam
Description Description
Parameters Parameters
- $terms
-
(Optional) Comma-separated list of terms
Default value: ''
- $topic_id
-
(Required)
- $reply_id
-
(Required)
Return Return
(array) Array of existing topic terms
Source Source
File: includes/extend/akismet.php
public function filter_post_terms( $terms = '', $topic_id = 0, $reply_id = 0 ) { // Validate the reply_id and topic_id $reply_id = bbp_get_reply_id( $reply_id ); $topic_id = bbp_get_topic_id( $topic_id ); // Get any pre-existing terms $existing_terms = bbp_get_topic_tag_names( $topic_id ); // Save the terms for later in case the reply gets hammed if ( ! empty( $terms ) ) { update_post_meta( $reply_id, '_bbp_akismet_spam_terms', $terms ); } // Keep the topic tags the same for now return $existing_terms; }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |