Automattic\WooCommerce\Internal\StockNotifications\Frontend

FormHandlerService::requires_nonce_checkpublic staticWC 1.0

Whether the form requires a nonce check.

Note: Nonce checks may be disabled for guest signups to support HTML caching.

Method of the class: FormHandlerService{}

Returns

true|false. True if the form requires a nonce check, false otherwise.

Usage

$result = FormHandlerService::requires_nonce_check(): bool;

FormHandlerService::requires_nonce_check() code WC 10.3.6

public static function requires_nonce_check(): bool {

	$requires_account = ProductPageIntegration::is_personalization_enabled() && ( Config::requires_account() || \is_user_logged_in() );

	/**
	 * Filter to require nonce check.
	 *
	 * @since 10.2.0
	 *
	 * @param bool $requires_nonce_check Whether to require nonce check.
	 * @return bool
	 */
	return (bool) apply_filters( 'woocommerce_customer_stock_notifications_requires_nonce_check', $requires_account );
}