AnsPress_Bad_words::before_inserting_question( boolean $return, string $str )
Description #
Hook to check bad words before inserting question into database.
Parameters #
- $returnboolean (Required) Return ajax response or boolean.
- $strstring (Required) Question form fields.
Source #
File: addons/free/bad-words.php
public static function before_inserting_question( $return, $str ) { $bad_words = SELF::find_bad_words( $str ); if ( false === $bad_words || empty( $bad_words ) ) { return $return; } return array( 'form' => ap_sanitize_unslash( 'ap_form_action' ), 'success' => false, 'snackbar' => [ 'message' => __( 'Don’t use foul or abusive language. Let everything you say be good and helpful.', 'anspress-question-answer' ) ], 'action' => 'bad_word_detected', ); }
Expand full source code Collapse full source code View on GitHub: addons/free/bad-words.php:55
Add your comment