woocommerce_api_create_product_data

woocommerce_api_create_product_data

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

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_api_create_product_data') is found 2 times:

  • /includes/legacy/api/v2/class-wc-api-products.php line 224
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    if ( ! current_user_can( 'publish_products' ) ) {
        throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_product', __( 'You do not have permission to create products', 'woocommerce' ), 401 );
    }
     
    $data = apply_filters( 'woocommerce_api_create_product_data', $data, $this );
     
    // Check if product title is specified
    if ( ! isset( $data['title'] ) ) {
        throw new WC_API_Exception( 'woocommerce_api_missing_product_title', sprintf( __( 'Missing parameter %s', 'woocommerce' ), 'title' ), 400 );
    }
  • /includes/legacy/api/v3/class-wc-api-products.php line 273
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    if ( ! current_user_can( 'publish_products' ) ) {
        throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_product', __( 'You do not have permission to create products', 'woocommerce' ), 401 );
    }
     
    $data = apply_filters( 'woocommerce_api_create_product_data', $data, $this );
     
    // Check if product title is specified.
    if ( ! isset( $data['title'] ) ) {
        throw new WC_API_Exception( 'woocommerce_api_missing_product_title', sprintf( __( 'Missing parameter %s', 'woocommerce' ), 'title' ), 400 );
    }