WordPress at Your Fingertips
function is not described

WC_Admin_Report::check_current_range_nonce() public WC 3.0.4

Check nonce for current range.

{} It's a method of the class: WC_Admin_Report{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Admin_Report = new WC_Admin_Report();
$WC_Admin_Report->check_current_range_nonce( $current_range );
$current_range(string) (required)
Current range.

Changelog

Since 3.0.4 Introduced.

Code of WC_Admin_Report::check_current_range_nonce() WC 5.8.0

public function check_current_range_nonce( $current_range ) {
	if ( 'custom' !== $current_range ) {
		return;
	}

	if ( ! isset( $_GET['wc_reports_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['wc_reports_nonce'] ), 'custom_range' ) ) { // WPCS: input var ok, CSRF ok.
		wp_die(
			/* translators: %1$s: open link, %2$s: close link */
			sprintf( esc_html__( 'This report link has expired. %1$sClick here to view the filtered report%2$s.', 'woocommerce' ), '<a href="' . esc_url( wp_nonce_url( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'custom_range', 'wc_reports_nonce' ) ) . '">', '</a>' ), // @codingStandardsIgnoreLine.
			esc_attr__( 'Confirm navigation', 'woocommerce' )
		);
		exit;
	}
}