woocommerce_api_delete_product_category

woocommerce_api_delete_product_category

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

do_action('woocommerce_api_delete_product_category') is found 1 times:

  • /includes/legacy/api/v3/class-wc-api-products.php line 864
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
            if ( ! $deleted || is_wp_error( $deleted ) ) {
                throw new WC_API_Exception( 'woocommerce_api_cannot_delete_product_category', __( 'Could not delete the category', 'woocommerce' ), 401 );
            }
     
            do_action( 'woocommerce_api_delete_product_category', $id, $this );
     
            return array( 'message' => sprintf( __( 'Deleted %s', 'woocommerce' ), 'product_category' ) );
        } catch ( WC_API_Exception $e ) {
            return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
        }
    }