woocommerce_api_server_before_serve action-hookWC 2.1

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.

Usage

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
-

Changelog

Since 2.1 Introduced.

Where the hook is called

WC_API_Server::serve_request()
woocommerce_api_server_before_serve
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 );
woocommerce/includes/legacy/api/v1/class-wc-api-server.php 206
do_action( 'woocommerce_api_server_before_serve', $this );

Where the hook is used in WooCommerce

Usage not found.