WordPress filter hook

woocommerce_sale_flash

Defined by WooCommerce and fired by 43 plugins in total, running on 8M+ sites between them.

How to use woocommerce_sale_flash

It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_sale_flash', function( $value, $post, $product ) {
	// Change $value here.
	return $value;
}, 10, 3 );

Argument names come from Royal Addons for Elementor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

43 plugins that fire woocommerce_sale_flash

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ) templates/loop/sale-flash.php:27
  2. Royal Addons for Elementor icon Royal Addons for Elementor600,000+ installs apply_filters( 'woocommerce_sale_flash', '<span>' . wp_kses_post($settings['product_media_sales_badge_text']) . '</span>', $post, $product ) modules/theme-builder/woocommerce/product-media/widgets/wpr-product-media.php:1593
  3. Discount Rules for WooCommerce icon Discount Rules for WooCommerce100,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale wdr-onsale">' . esc_html__( 'Sale!', 'woo-discount-rules' ) . '</span>', $post, $product ) v2/App/Views/Templates/loop/sale-flash.php:23
  4. ShopLentor icon ShopLentor80,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woolentor-pro' ) . '</span>', $post, $product ) includes/addons/wl_product_video_gallery.php:268
  5. Easy Accordion icon Easy Accordion70,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'easy-accordion-free' ) . '</span>', $product, '' ) Blocks/Includes/Blocks_Query.php:323
  6. Gutentor icon Gutentor30,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'gutentor' ) . '</span>', $post, $product ) includes/block-base/class-gutentor-query-elements.php:2308
  7. Carousel Slider icon Carousel Slider30,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'carousel-slider' ) . '</span>', $product ) modules/ProductCarousel/Module.php:151
  8. SpiceBox icon SpiceBox20,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'On Sale!', 'spicebox' ) . '</span>', $product ) inc/innofit/sections/innofit-wooproduct-section.php:39
  9. Burger Companion icon Burger Companion10,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="badge">' . esc_html__( 'Sale', 'appetizer' ) . '</span>', $post, $product ) inc/appetizer/sections/section-product.php:46
  10. Ibtana icon Ibtana10,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ) dist/post/plugin-post.php:2631
  11. Nexter Blocks icon Nexter Blocks9,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="badge onsale perc">↓ ' . $maximumper . '%</span>', $post, $product ) classes/tp-core-init-blocks.php:1645
  12. aThemes Blocks icon aThemes Blocks7,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post_id, $product ) includes/Blocks/Helper/PostGrid.php:63
  13. Spexo Addons for Elementor icon Spexo Addons for Elementor6,000+ installs apply_filters( 'woocommerce_sale_flash', '<span>' . wp_kses_post($settings['product_media_sales_badge_text']) . '</span>', $post, $product ) inc/widgets/woo-product-media.php:1753
  14. A WP Life Companion icon A WP Life Companion6,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'On Sale!', 'formula' ) . '</span>', $loop->post, $product ) inc/neom/front-page/section-woocommerce.php:51
  15. eCommerce Companion icon eCommerce Companion5,000+ installs apply_filters( 'woocommerce_sale_flash', '<div class="sale-ribbon"><span class="tag-line">' . esc_html__( 'Sale', 'ecommerce-companion' ) .'</span></div>', $product ) inc/themes/electromix-digital/sections/section-category-two.php:70
  16. WPify Woo icon WPify Woo5,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'wpify-woo' ) . '</span>', $post, $product ) src/Modules/Prices/woocommerce/single-product/sale-flash.php:19
  17. Fable Extra icon Fable Extra4,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale', 'fable-extra' ) . '</span>', $product ) inc/woo-features/fable-extra-quick-view.php:26
  18. Britetechs Companion icon Britetechs Companion2,000+ installs apply_filters( 'woocommerce_sale_flash', '<div class="sale_ribbon"><span class="tag_line">' . esc_html__( 'Sale', 'jewelry-store' ) . '</span></div>', $post, $product ) inc/jewelry-store/section-all/section-shop.php:104
  19. WPFrank Companion icon WPFrank Companion1,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="product-sale">' . esc_html__( 'On Sale!', 'wpfrank-companion' ) . '</span>', $post, $product ) inc/businessexpo/front-page/wpfrank-companion-businessexpo-woocommerce.php:54
  20. Related Products Slider for WooCommerce icon Related Products Slider for WooCommerce1,000+ installs apply_filters( 'woocommerce_sale_flash', '<span class="wpb_wrps_onsale">' . esc_html__( 'Sale!', 'wpb-wrps' ) . '</span>', $post, $product ) templates/wrps-content-product.php:18
  21. ShopPress icon ShopPress600+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . wp_kses_post( $before_icon . $label . $after_icon ) . '</span>', $post, $product ) public/templates/loop/loop-sale-flash.php:38
  22. StoreBuild icon StoreBuild400+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__('Sale!', 'shopbuild') . '</span>', $post, $product ) public/woocommerce/single-product/sale-flash.php:31
  23. Noah Shop Builder for WooCommerce icon Noah Shop Builder for WooCommerce400+ installs apply_filters( 'woocommerce_sale_flash', $sale, get_post( $product->get_id() ), $product ) includes/Blocks/ProductCard.php:353
  24. Food Online for WooCommerce icon Food Online for WooCommerce300+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', '', $product ) classes/class-fdoe-ajax.php:259
  25. CRT Addons Builder and Widgets for Elementor icon CRT Addons Builder and Widgets for Elementor300+ installs apply_filters( 'woocommerce_sale_flash', '<span>' . wp_kses_post($settings['product_media_sales_badge_text']) . '</span>', $post, $product ) includes/customizer/addons/modules/woocommerce/crt-product-media.php:1717
  26. Visual Builder icon Visual Builder200+ installs apply_filters( 'woocommerce_sale_flash', '<div class="vb-txt-product-sale '.vb_product_badge_class($post_data,'sale',$single).'">' .$sale . '</div>', $post, $product ) inc/woocommerce/product.php:773
  27. CSSIgniter Quick View for WooCommerce icon CSSIgniter Quick View for WooCommerce70+ installs apply_filters( 'woocommerce_sale_flash', '<span class="quickviewwoo-onsale">' . esc_html__( 'Sale!', 'quick-view-woo' ) . '</span>', $post, $product ) includes/class-qvw-modal.php:102
  28. RT Elementor Widgets icon RT Elementor Widgets50+ installs apply_filters( 'woocommerce_sale_flash', '<div class="sales-tag"><span>' .absint( $discount ) . esc_html__( '% off Sale!', 'rt-elementor-widget' ) . '</span></div>', $post, $product ) widgets/rt-woo-carousel.php:410
  29. Related Products Slider for WooCommerce icon Related Products Slider for WooCommerce30+ installs apply_filters( 'woocommerce_sale_flash', '<span class="rp_onsale rp_ribbon_top_right">Sale</span>', $post, $product ) includes/rp-shortcode.php:124
  30. Elite Elementor Addons and Widgets icon Elite Elementor Addons and Widgets20+ installs apply_filters( 'woocommerce_sale_flash', '<span>' . wp_kses_post($settings['product_media_sales_badge_text']) . '</span>', $post, $product ) modules/theme-builder/woocommerce/product-media/widgets/elite-product-media.php:1586
  31. WooLayout icon WooLayout10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ) lib/woolayout/loop/sale-flash.php:27
  32. Awesome Carousel Slider icon Awesome Carousel Slider10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'carousel-slider' ) . '</span>', $product ) includes/class-carousel-slider-product.php:134
  33. WCBox Lite icon WCBox Lite10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale" style="z-index:1">' . __( 'Sale!', 'wc-box' ) . '</span>', $product ) public/shortcode/product_shortcode.php:16
  34. Themofy Addons for Elementor icon Themofy Addons for Elementor10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'themofy-dynamic-tags-for-elementor' ) . '</span>', get_post( $product->get_id() ), $product ) modules/woocommerce/includes/class-card-renderer.php:481
  35. UnifiedSMB for WooCommerce icon UnifiedSMB for WooCommerce10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ) includes/promotions/class-promotions.php:72
  36. Custom Builder for Elementor and WooCommerce icon Custom Builder for Elementor and WooCommerce10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . $badge_text . '</span>', $post, $product ) templates/custom-single-sale-badge/global/index.php:13
  37. Onex Custom Woo Builder icon Onex Custom Woo Builder10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . $badge_text . '</span>', $post, $product ) templates/custom-single-sale-badge/global/index.php:13
  38. Product Explode Plugin icon Product Explode Plugin10+ installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__('Sale!', 'woocommerce') . '</span>', $post, $product ) woocommerce/single-product/sale-flash.php:27
  39. StoreBooster icon StoreBoosterFewer than 10 installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'storebooster' ) . '</span>', null, $product ) templates/gallery-slider/product-gallery.php:61
  40. NexoBlocks icon NexoBlocksFewer than 10 installs apply_filters( 'woocommerce_sale_flash', __( 'Sale!', 'woocommerce' ), $product, $product ) build/blocks/woo-product-comparison/render-woo-product-comparison.php:479
  41. ShopXpert icon ShopXpertFewer than 10 installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'shopxpert' ) . '</span>', $post, $product ) incs/helper-function.php:953
  42. InstaView for WooCommerce icon InstaView for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'instaview-for-woocommerce' ) . '</span>', $post, $product ) includes/frontend/instaview/sale-flash.php:33
  43. X-Extensions for WooCommerce icon X-Extensions for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'x-extensions-for-woocommerce' ) . '</span>', $post, $product ) shortcode/ProductListing.php:49

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.