woocommerce_store_api_expose_error_details │ хук-фильтр │ WC 11.3.0

Filters whether unexpected Store API failures include the error message and exception class in the response.

Details are only ever sent to users who can manage WooCommerce; this filter cannot bypass that check. It defaults to WP_DEBUG so store staff can debug a production store without enabling debug mode site-wide.

Использование

add_filter( 'woocommerce_store_api_expose_error_details', 'wp_kama_woocommerce_store_api_expose_error_details_filter' );

/**
 * Function for `woocommerce_store_api_expose_error_details` filter-hook.
 * 
 * @param bool $expose_error_details Whether to include the error message and exception class.
 *
 * @return bool
 */
function wp_kama_woocommerce_store_api_expose_error_details_filter( $expose_error_details ){
	// filter...
	return $expose_error_details;
}
$expose_error_details(true|false)
Whether to include the error message and exception class.
По умолчанию: WP_DEBUG

Список изменений

С версии 11.3.0 Введена.

Где вызывается хук

UnexpectedErrorResponse::can_expose_details()
woocommerce_store_api_expose_error_details
woocommerce/src/StoreApi/Utilities/UnexpectedErrorResponse.php 95
$expose_error_details = (bool) apply_filters( 'woocommerce_store_api_expose_error_details', Constants::is_true( 'WP_DEBUG' ) );

Где используется хук в WooCommerce

Использование не найдено.