woocommerce_api_server_before_serve
Handle serving an API request
Matches the current server URI to a route and runs the first matching callback then outputs a JSON representation of the returned value.
Использование
add_action( 'woocommerce_api_server_before_serve', 'wp_kama_woocommerce_api_server_before_serve_action' ); /** * Function for `woocommerce_api_server_before_serve` action-hook. * * @param $that * * @return void */ function wp_kama_woocommerce_api_server_before_serve_action( $that ){ // action... }
- $that
- -
Список изменений
С версии 2.1 | Введена. |
Где вызывается хук
woocommerce/includes/legacy/api/v1/class-wc-api-server.php 206
do_action( 'woocommerce_api_server_before_serve', $this );
woocommerce/includes/legacy/api/v3/class-wc-api-server.php 204
do_action( 'woocommerce_api_server_before_serve', $this );
woocommerce/includes/legacy/api/v2/class-wc-api-server.php 204
do_action( 'woocommerce_api_server_before_serve', $this );