woocommerce_api_serve_request
The WooCommerce woocommerce api serve request hook.
Description
Parameters (3)
- 0. $false (bool) =>
false
- The false.
- 1. $result (unknown)
- The result.
- 2. $instance (unknown)
- The instance.
Usage
- To run the hook, copy the example below.
- $false = apply_filters( 'woocommerce_api_serve_request', $false, $result, $instance );
- if ( !empty( $false ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the woocommerce_api_serve_request callback
- function filter_woocommerce_api_serve_request( $false, $result, $instance ) {
- // make filter magic happen here...
- return $false;
- };
- // add the filter
- add_filter( 'woocommerce_api_serve_request', 'filter_woocommerce_api_serve_request', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'woocommerce_api_serve_request', 'filter_woocommerce_api_serve_request', 10, 3 );
Defined (3)
The filter is defined in the following location(s).
- /includes/api/legacy/v3/class-wc-api-server.php
- $served = apply_filters( 'woocommerce_api_serve_request', false, $result, $this );
- /includes/api/legacy/v2/class-wc-api-server.php
- $served = apply_filters( 'woocommerce_api_serve_request', false, $result, $this );
- /includes/api/legacy/v1/class-wc-api-server.php
- $served = apply_filters( 'woocommerce_api_serve_request', false, $result, $this );