woocommerce_api_enabled filter-hookWC 1.0

the API is enabled by default

Usage

add_filter( 'woocommerce_api_enabled', 'wp_kama_woocommerce_api_enabled_filter', 10, 2 );

/**
 * Function for `woocommerce_api_enabled` filter-hook.
 * 
 * @param  $true 
 * @param  $that 
 *
 * @return 
 */
function wp_kama_woocommerce_api_enabled_filter( $true, $that ){

	// filter...
	return $true;
}
$true
-
$that
-

Where the hook is called

WC_API_Server::serve_request()
woocommerce_api_enabled
woocommerce/includes/legacy/api/v1/class-wc-api-server.php 211
if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {
woocommerce/includes/legacy/api/v3/class-wc-api-server.php 209
if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {
woocommerce/includes/legacy/api/v2/class-wc-api-server.php 209
if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {

Where the hook is used in WooCommerce

Usage not found.