WordPress filter hook
woocommerce_product_get_regular_price
Fired by 6 WordPress plugins, running on 357K+ sites between them.
“Do woocommerce_product_get_regular_price”
How to use woocommerce_product_get_regular_price
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_product_get_regular_price', function( $regularPrice, $objInfo ) {
// Change $regularPrice here.
return $regularPrice;
}, 10, 2 );Argument names come from Unlimited Elements for Elementor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
6 plugins that fire woocommerce_product_get_regular_price
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Unlimited Elements for Elementor300,000+ installs
apply_filters( 'woocommerce_product_get_regular_price', $regularPrice, $objInfo )provider/woocommerce_integrate.class.php:735 -
Product Filter for WooCommerce by WBW50,000+ installs
apply_filters( 'woocommerce_product_get_regular_price', $raw_price, null )modules/woofilters/class-woobewoo-pf-woofilters.php:3182 -
Product Bundle Builder for WooCommerce6,000+ installs
apply_filters( 'woocommerce_product_get_regular_price', $prices['regular'], $this )src/ProductBundle.php:522 -
Unlimited Elements Blocks Library500+ installs
apply_filters( 'woocommerce_product_get_regular_price', $regularPrice, $objInfo )provider/woocommerce_integrate.class.php:735 -
WupSales20+ installs
apply_filters( 'woocommerce_product_get_regular_price', $rawPrice, null )modules/bonuses/mod.php:245 -
Fuzzy FilterFewer than 10 installs
apply_filters( 'woocommerce_product_get_regular_price', $range[0], null )modules/filters/models/class-price.php:165
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.