Automattic\WooCommerce\Internal\CustomerEmailVerification

VerificationController::print_result_noticepublicWC 11.0.0

Print the one-off result notice carried by the {@see self::NOTICE_PARAM} query arg, if any.

Send/confirm actions redirect here with a result code rather than queuing a session notice, so the page shows exactly the current request's outcome — re-running an action can't stack notices.

Method of the class: VerificationController{}

No Hooks.

Returns

null. Nothing (null).

Usage

$VerificationController = new VerificationController();
$VerificationController->print_result_notice(): void;

Changelog

Since 11.0.0 Introduced.

VerificationController::print_result_notice() code WC 11.0.0

public function print_result_notice(): void {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- display-only, no state change.
	$code   = isset( $_GET[ self::NOTICE_PARAM ] ) ? sanitize_key( wp_unslash( $_GET[ self::NOTICE_PARAM ] ) ) : '';
	$notice = $this->result_notice( $code );

	if ( null !== $notice ) {
		wc_print_notice( esc_html( $notice[0] ), $notice[1] );
	}
}