woocommerce_store_api_disable_nonce_check
Filters the Store API nonce check.
This can be used to disable the nonce check when testing API endpoints via a REST API client.
Использование
add_filter( 'woocommerce_store_api_disable_nonce_check', 'wp_kama_woocommerce_store_api_disable_nonce_check_filter' ); /** * Function for `woocommerce_store_api_disable_nonce_check` filter-hook. * * @param boolean $disable_nonce_check If true, nonce checks will be disabled. * * @return boolean */ function wp_kama_woocommerce_store_api_disable_nonce_check_filter( $disable_nonce_check ){ // filter... return $disable_nonce_check; }
- $disable_nonce_check(true|false)
- If true, nonce checks will be disabled.
Список изменений
С версии 4.5.0 | Введена. |
Где вызывается хук
woocommerce_store_api_disable_nonce_check
woocommerce/packages/woocommerce-blocks/src/StoreApi/Routes/V1/AbstractCartRoute.php 295
if ( apply_filters( 'woocommerce_store_api_disable_nonce_check', false ) ) {
Где используется хук в WooCommerce
woocommerce/packages/woocommerce-blocks/src/BlockTypes/Checkout.php 437
add_filter( 'woocommerce_store_api_disable_nonce_check', '__return_true' );
woocommerce/packages/woocommerce-blocks/src/BlockTypes/Checkout.php 442
remove_filter( 'woocommerce_store_api_disable_nonce_check', '__return_true' );