woocommerce_api_create_product_attribute_data

woocommerce_api_create_product_attribute_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_attribute_data') is found 2 times:

  • /includes/legacy/api/v2/class-wc-api-products.php line 1977
    1973
    1974
    1975
    1976
    1977
    1978
    1979
    1980
    1981
    1982
    1983
    if ( ! current_user_can( 'manage_product_terms' ) ) {
        throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_product_attribute', __( 'You do not have permission to create product attributes', 'woocommerce' ), 401 );
    }
     
    $data = apply_filters( 'woocommerce_api_create_product_attribute_data', $data, $this );
     
    if ( ! isset( $data['name'] ) ) {
        $data['name'] = '';
    }
     
    // Set the attribute slug
  • /includes/legacy/api/v3/class-wc-api-products.php line 2530
    2526
    2527
    2528
    2529
    2530
    2531
    2532
    2533
    2534
    2535
    2536
    if ( ! current_user_can( 'manage_product_terms' ) ) {
        throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_product_attribute', __( 'You do not have permission to create product attributes', 'woocommerce' ), 401 );
    }
     
    $data = apply_filters( 'woocommerce_api_create_product_attribute_data', $data, $this );
     
    if ( ! isset( $data['name'] ) ) {
        $data['name'] = '';
    }
     
    // Set the attribute slug.