WordPress filter hook

wc_price

Fired by 34 WordPress plugins, running on 8M+ sites between them.

“Filters the string of price markup.”

How to use wc_price

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( 'wc_price', function( $return, $price, $args ) {
	// Change $return here.
	return $return;
}, 10, 3 );

Argument names come from YITH WooCommerce Wishlist's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

34 plugins that fire wc_price

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( 'wc_price', $return, $price, $args, $unformatted_price, $original_price ) includes/wc-formatting-functions.php:673
  2. YITH WooCommerce Wishlist icon YITH WooCommerce Wishlist400,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  3. YITH WooCommerce Compare icon YITH WooCommerce Compare100,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  4. YITH WooCommerce Quick View icon YITH WooCommerce Quick View80,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  5. YITH WooCommerce Ajax Product Filter icon YITH WooCommerce Ajax Product Filter70,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  6. YITH WooCommerce Catalog Mode icon YITH WooCommerce Catalog Mode60,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  7. FOX icon FOX50,000+ installs apply_filters( 'wc_price', $return, $price, $args, $unformatted_price ) classes/woocs.php:4127
  8. Advanced Product Fields (Product Addons) for WooCommerce icon Advanced Product Fields (Product Addons) for WooCommerce50,000+ installs apply_filters( 'wc_price', $return, $price, $args, $unformatted_price, $original_price ) includes/classes/class-helper.php:123
  9. YITH WooCommerce Ajax Search icon YITH WooCommerce Ajax Search30,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  10. YITH WooCommerce Product Add-Ons icon YITH WooCommerce Product Add-Ons20,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  11. YITH WooCommerce Product Gallery & Image Zoom icon YITH WooCommerce Product Gallery & Image Zoom10,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  12. YITH Request a Quote for WooCommerce icon YITH Request a Quote for WooCommerce10,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  13. YITH WooCommerce Badge Management icon YITH WooCommerce Badge Management10,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  14. YITH WooCommerce Gift Cards icon YITH WooCommerce Gift Cards10,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  15. YITH Infinite Scrolling icon YITH Infinite Scrolling9,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  16. YITH Color and Label Variations for WooCommerce icon YITH Color and Label Variations for WooCommerce8,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  17. YITH WooCommerce Brands Add-On icon YITH WooCommerce Brands Add-On8,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  18. YITH Frequently Bought Together for WooCommerce icon YITH Frequently Bought Together for WooCommerce7,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  19. YITH WooCommerce Order & Shipment Tracking icon YITH WooCommerce Order & Shipment Tracking6,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  20. YITH WooCommerce Subscription icon YITH WooCommerce Subscription6,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  21. YITH WooCommerce Affiliates icon YITH WooCommerce Affiliates6,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  22. YITH Pre-Order for WooCommerce icon YITH Pre-Order for WooCommerce5,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  23. Coupon Affiliates icon Coupon Affiliates5,000+ installs apply_filters( 'wc_price', $return, $price, $args, $unformatted_price, $original_price ) inc/functions/functions-calculate-order.php:2746
  24. YITH Essential Kit for WooCommerce #1 icon YITH Essential Kit for WooCommerce #14,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  25. YITH WooCommerce Product Slider Carousel icon YITH WooCommerce Product Slider Carousel4,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  26. YITH WooCommerce Tab Manager icon YITH WooCommerce Tab Manager3,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  27. YITH WooCommerce Product Bundles icon YITH WooCommerce Product Bundles3,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  28. YITH WooCommerce Waitlist icon YITH WooCommerce Waitlist3,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  29. YITH WooCommerce Featured Video icon YITH WooCommerce Featured Video3,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  30. YITH WooCommerce Popup icon YITH WooCommerce Popup2,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  31. YITH PayPal Express Checkout for WooCommerce icon YITH PayPal Express Checkout for WooCommerce1,000+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/yit-functions.php:1002
  32. Splitit for WooCommerce icon Splitit for WooCommerce80+ installs apply_filters( 'wc_price', $return, $price, $args, $unformatted_price, $original_price ) splitIt-flexfields-payment-gateway.php:7377
  33. SMM API icon SMM API40+ installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/smm-functions.php:908
  34. D7SMS for Woocommerce icon D7SMS for WoocommerceFewer than 10 installs apply_filters( 'wc_price', $return, $price, $args ) plugin-fw/d7-functions.php:655

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.