WC_Admin_Report::check_current_range_nonce() public WC 3.0.4
Check nonce for current range.
{} Это метод класса: WC_Admin_Report{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$WC_Admin_Report = new WC_Admin_Report(); $WC_Admin_Report->check_current_range_nonce( $current_range );
- $current_range(строка) (обязательный)
- Current range.
Список изменений
С версии 3.0.4 | Введена. |
Код WC_Admin_Report::check_current_range_nonce() WC Admin Report::check current range nonce WC 5.0.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;
}
}