ID); $mc4wp_text = do_shortcode( '[mc4wp_form id="' . $form->ID . '"]' ); $cfturnstile_key = sanitize_text_field( get_option( 'cfturnstile_key' ) ); if ( !has_shortcode( $post->post_content, 'mc4wp-simple-turnstile') ) { return $errors; } if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { $check = cfturnstile_check(); $success = $check['success']; if($success != true) { $errors[] = 'cf_turnstile_error'; } } else { $errors[] = 'cf_turnstile_error'; } } return $errors; } // MC4WP Error Message function cfturnstile_mc4wp_error_message($messages) { $messages['cf_turnstile_error'] = cfturnstile_failed_message(); return $messages; } add_filter('mc4wp_form_messages', 'cfturnstile_mc4wp_error_message');