woocommerce_product_importer_read_attribute

woocommerce_product_importer_read_attribute

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.10.6.1

apply_filters('woocommerce_product_importer_read_attribute') is found 2 times:

  • /includes/import/abstract-wc-product-importer.php line 427
    						 * @param WC_Product_Attribute $attribute_object  The attribute object.
    						 * @param array                $attribute         The attribute data.
    						 * @param WC_Product           $product           The product object.
    						 */
    						$attributes[] = apply_filters( 'woocommerce_product_importer_read_attribute', $attribute_object, $attribute, $product );
    					}
    				} elseif ( isset( $attribute['value'] ) ) {
    					// Check for default attributes and set "is_variation".
    					if ( ! empty( $attribute['default'] ) && in_array( $attribute['default'], $attribute['value'], true ) ) {
    						$default_attributes[ sanitize_title( $attribute['name'] ) ] = $attribute['default'];
    						$is_variation = 1;
    
  • /includes/import/abstract-wc-product-importer.php line 444
    					$attribute_object->set_visible( $is_visible );
    					$attribute_object->set_variation( $is_variation );
    
    					// phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment -- see same filter in the 'if' block.
    					$attributes[] = apply_filters( 'woocommerce_product_importer_read_attribute', $attribute_object, $attribute, $product );
    				}
    			}
    
    			$product->set_attributes( $attributes );
    
    			// Set variable default attributes.