wpcf7_quiz_validation_filter()
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
wpcf7_quiz_validation_filter( $result, $tag );
- $result (обязательный)
- -
- $tag (обязательный)
- -
Код wpcf7_quiz_validation_filter() wpcf7 quiz validation filter CF7 5.9.8
function wpcf7_quiz_validation_filter( $result, $tag ) { $name = $tag->name; $answer = wp_unslash( $_POST[$name] ?? '' ); $answer = wpcf7_canonicalize( $answer, array( 'strip_separators' => true, ) ); $answer_hash = wp_hash( $answer, 'wpcf7_quiz' ); $expected_hash = (string) ( $_POST['_wpcf7_quiz_answer_' . $name] ?? '' ); if ( ! hash_equals( $expected_hash, $answer_hash ) ) { $result->invalidate( $tag, wpcf7_get_message( 'quiz_answer_not_correct' ) ); } return $result; }