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.
// 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
-
/** * Hook to add custom fields to the attribute term add/edit screen. */ do_action( 'wc_variation_swatches_add_edit_hover_image', $attribute_tax ); -
apply_filters( 'wc_variation_swatch_attribute_html', '', $term, $attr, $args ); -
apply_filters( 'wc_variation_swatches_attr_name', '', $name, $term ); -
apply_filters( 'wc_variation_swatches_attribute_columns', array_merge( $new_columns, $columns ) ); -
apply_filters( 'wc_variation_swatches_attribute_fields', wcvs_get_attribute_types() ); -
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-... ); -
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... ); -
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', ), ) ); -
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', ), ) ); -
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', ), ) ); -
apply_filters( 'wc_variation_swatches_shape_height', $shape_height, $term ); -
apply_filters( 'wc_variation_swatches_shape_style', $shape_style, $term ); -
apply_filters( 'wc_variation_swatches_shape_width', $shape_width, $term ); -
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', ), ) ); -
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... ); -
apply_filters( 'wcvs_attribute_types', $types ); -
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.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin 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 thisNot 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: