Product Variation Swatches for WooCommerce icon
eCommerce & WooCommerce

Product Variation Swatches for WooCommerce hooks reference

Product Variation Swatches for WooCommerce 2.2.1 has 1 actions and 16 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Product Variation Swatches for WooCommerce fires an action
add_action( 'wc_variation_swatches_add_edit_hover_image', function( $attribute_tax ) {
	// Your code runs here.
}, 10, 1 );

// Change a value Product Variation Swatches for WooCommerce is about to use
add_filter( 'wc_variation_swatch_attribute_html', function( $value, $term, $attr, $args ) {
	// Change $value here.
	return $value;
}, 10, 4 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • includes/Admin/Admin.php line 163 · used in 2 places
    /**
     * Hook to add custom fields to the attribute term add/edit screen.
     */
    do_action( 'wc_variation_swatches_add_edit_hover_image', $attribute_tax );
  • includes/Frontend/Products.php line 214
    apply_filters( 'wc_variation_swatch_attribute_html', '', $term, $attr, $args );
  • includes/Frontend/Products.php line 281
    apply_filters( 'wc_variation_swatches_attr_name', '', $name, $term );
  • includes/Admin/Admin.php line 279
    apply_filters( 'wc_variation_swatches_attribute_columns', array_merge( $new_columns, $columns ) );
  • includes/Admin/Admin.php line 242
    apply_filters( 'wc_variation_swatches_attribute_fields', wcvs_get_attribute_types() );
  • includes/Admin/Settings.php line 333
    apply_filters( 'wc_variation_swatches_catalog_label_position', array( 'title' => __( 'Label Position', 'wc-variation-swatches' ), 'desc' => __( 'Select the position where you want to show the variation label on shop/catalog page. <strong>This feature is only available in PRO version.</strong>', 'wc-variation-swatches' ), 'id' => 'catalog_label_position', 'type' => 'select', 'default' => 'inline', 'options' => array( 'inline' => __( 'Inline', 'wc-variation-... );
  • includes/Admin/Settings.php line 364
    apply_filters( 'wc_variation_swatches_catalog_pos', array( 'title' => __( 'Catalog Swatches Position', 'wc-variation-swatches' ), 'desc' => __( 'Select the position where you want to show the swatches in the shop/catalog pages. <strong>This feature is only available in PRO version.</strong>', 'wc-variation-swatches' ), 'id' => 'catalog_pos', 'type' => 'select', 'default' => '1', 'options' => array( '1' => __( 'After item title and price', 'wc-va... );
  • includes/Admin/Settings.php line 351
    apply_filters( 'wc_variation_swatches_catalog_show_attr', array( 'title' => __( 'Show Attribute Name', 'wc-variation-swatches' ), 'desc' => __( 'Show attribute name on shop/catalog pages. <strong>This feature is only available in PRO version.</strong>', 'wc-variation-swatches' ), 'id' => 'catalog_show_attr', 'type' => 'checkbox', 'default' => 'no', 'custom_attributes' => array( 'disabled' => 'disabled', ), ) );
  • includes/Admin/Settings.php line 320
    apply_filters( 'wc_variation_swatches_catalog_show_variation_label', array( 'title' => __( 'Show Variation Label', 'wc-variation-swatches' ), 'desc' => __( 'Show variation label in the shop/catalog pages.', 'wc-variation-swatches' ), 'id' => 'catalog_show_variation_label', 'type' => 'checkbox', 'default' => 'no', 'custom_attributes' => array( 'disabled' => 'disabled', ), ) );
  • includes/Admin/Settings.php line 307
    apply_filters( 'wc_variation_swatches_enable_catalog_swatches', array( 'title' => __( 'Enable Catalog Swatches', 'wc-variation-swatches' ), 'desc' => __( 'Enable / Disable swatches on shop/catalog pages. This will be applied globally. <strong>This feature is only available in PRO version.</strong>', 'wc-variation-swatches' ), 'id' => 'enable_catalog_swatches', 'type' => 'checkbox', 'default' => 'no', 'custom_attributes' => array( 'disabled' => 'disabled', ), ) );
  • includes/Frontend/Products.php line 249
    apply_filters( 'wc_variation_swatches_shape_height', $shape_height, $term );
  • includes/Frontend/Products.php line 252
    apply_filters( 'wc_variation_swatches_shape_style', $shape_style, $term );
  • includes/Frontend/Products.php line 248
    apply_filters( 'wc_variation_swatches_shape_width', $shape_width, $term );
  • includes/Admin/Settings.php line 134
    apply_filters( 'wc_variation_swatches_show_attr', array( 'title' => __( 'Show Attribute Name', 'wc-variation-swatches' ), 'desc' => __( 'Show attribute name on single product page. <strong>This feature is only available in PRO version.</strong>', 'wc-variation-swatches' ), 'id' => 'show_attr', 'type' => 'checkbox', 'default' => 'no', 'custom_attributes' => array( 'disabled' => 'disabled', ), ) );
  • includes/functions.php line 142
    apply_filters( 'wcvs_allowed_html_tags', array( 'fieldset' => array(), 'label' => array( 'for' => array(), 'style' => array(), ), 'input' => array( 'type' => array(), 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'data-default-color' => array(), 'disabled' => array(), 'checked' => array(), 'placeholder' => array(), 'min' => array(), 'max' => array(), 'step' => array(), ), 'textarea' => array( 'class' => a... );
  • includes/functions.php line 18
    apply_filters( 'wcvs_attribute_types', $types );
  • includes/Admin/Admin.php line 374
    apply_filters( 'woocommerce_product_attribute_term_name', $term->name, $term );

Generated from Product Variation Swatches for WooCommerce's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Done for you

Rather have it built for you?

Tell us what should change and we’ll write and test the code using these hooks.

Plugin customisation

from $149

New features or changed behaviour, without editing the plugin’s files.

  • Built as a companion plugin, so updates never wipe it
  • Exact quote before we start
  • Tested on staging, then deployed

Typical turnaround: 3–7 business days

Choose this

Not sure which fits? Describe what you need and we’ll suggest the simplest option.

Can't find the right hook?

We can build the customisation for you. Describe what you need: