WC_Admin_Report::check_current_range_nonce
Check nonce for current range.
Метод класса: WC_Admin_Report{}
Хуков нет.
Возвращает
null. Ничего (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 10.3.4
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' ) ) {
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotValidated
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>' ),
esc_attr__( 'Confirm navigation', 'woocommerce' )
);
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotValidated
exit;
}
}