wpcf7_disallowed_list() CF7 1.0
Возвращает
Null. Ничего.
Использование
wpcf7_disallowed_list( $spam, $submission );
Код wpcf7_disallowed_list() wpcf7 disallowed list CF7 5.3.2
function wpcf7_disallowed_list( $spam, $submission ) {
if ( $spam ) {
return $spam;
}
$target = wpcf7_array_flatten( $submission->get_posted_data() );
$target[] = $submission->get_meta( 'remote_ip' );
$target[] = $submission->get_meta( 'user_agent' );
$target = implode( "\n", $target );
$word = wpcf7_check_disallowed_list( $target );
$word = wpcf7_apply_filters_deprecated(
'wpcf7_submission_is_blacklisted',
array( $word, $submission ),
'5.3',
'wpcf7_submission_has_disallowed_words'
);
$word = apply_filters(
'wpcf7_submission_has_disallowed_words',
$word,
$submission
);
if ( $word ) {
if ( is_bool( $word ) ) {
$reason = __( "Disallowed words are used.", 'contact-form-7' );
} else {
$reason = sprintf(
__( "Disallowed words (%s) are used.", 'contact-form-7' ),
implode( ', ', (array) $word )
);
}
$submission->add_spam_log( array(
'agent' => 'disallowed_list',
'reason' => $reason,
) );
}
$spam = (bool) $word;
return $spam;
}