wpcf7_captcha_display_warning_message()CF7 1.0

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wpcf7_captcha_display_warning_message( $page, $action, $object );
$page(обязательный)
.
$action(обязательный)
.
$object(обязательный)
.

Код wpcf7_captcha_display_warning_message() CF7 6.1.3

function wpcf7_captcha_display_warning_message( $page, $action, $object ) {
	if ( $object instanceof WPCF7_ContactForm ) {
		$contact_form = $object;
	} else {
		return;
	}

	$has_tags = (bool) $contact_form->scan_form_tags(
		array( 'type' => array( 'captchac' ) )
	);

	if ( ! $has_tags ) {
		return;
	}

	if ( ! class_exists( 'ReallySimpleCaptcha' ) ) {
		return;
	}

	$uploads_dir = wpcf7_captcha_tmp_dir();
	wpcf7_init_captcha();

	if ( ! is_dir( $uploads_dir ) or ! wp_is_writable( $uploads_dir ) ) {
		wp_admin_notice(
			sprintf(
				/* translators: %s: Path to the temporary folder */
				__( 'This contact form contains CAPTCHA fields, but the temporary folder for the files (%s) does not exist or is not writable. You can create the folder or change its permission manually.', 'contact-form-7' ),
				$uploads_dir
			),
			array( 'type' => 'warning' )
		);
	}

	if (
		! function_exists( 'imagecreatetruecolor' ) or
		! function_exists( 'imagettftext' )
	) {
		wp_admin_notice(
			__( 'This contact form contains CAPTCHA fields, but the necessary libraries (GD and FreeType) are not available on your server.', 'contact-form-7' ),
			array( 'type' => 'warning' )
		);
	}
}