woocommerce_api_enabled

woocommerce_api_enabled

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_api_enabled') is found 3 times:

  • /includes/legacy/api/v1/class-wc-api-server.php line 211
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    $this->header( 'Content-Type', $this->handler->get_content_type(), true );
     
    // the API is enabled by default
    if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {
     
        $this->send_status( 404 );
     
        echo $this->handler->generate_response( array( 'errors' => array( 'code' => 'woocommerce_api_disabled', 'message' => 'The WooCommerce API is disabled on this site' ) ) );
     
        return;
  • /includes/legacy/api/v2/class-wc-api-server.php line 209
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    $this->header( 'Content-Type', $this->handler->get_content_type(), true );
     
    // the API is enabled by default
    if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {
     
        $this->send_status( 404 );
     
        echo $this->handler->generate_response( array( 'errors' => array( 'code' => 'woocommerce_api_disabled', 'message' => 'The WooCommerce API is disabled on this site' ) ) );
     
        return;
  • /includes/legacy/api/v3/class-wc-api-server.php line 209
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    $this->header( 'Content-Type', $this->handler->get_content_type(), true );
     
    // the API is enabled by default
    if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {
     
        $this->send_status( 404 );
     
        echo $this->handler->generate_response( array( 'errors' => array( 'code' => 'woocommerce_api_disabled', 'message' => 'The WooCommerce API is disabled on this site' ) ) );
     
        return;