WordPress filter hook
wlbackorder_cart_product_not_enough_stock_message
Fired by 2 WordPress plugins, running on 80K+ sites between them.
How to use wlbackorder_cart_product_not_enough_stock_message
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:
add_filter( 'wlbackorder_cart_product_not_enough_stock_message', function( $message, $product_data, $can_add_to_cart_max ) {
// Change $message here.
return $message;
}, 10, 3 );Argument names come from ShopLentor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
2 plugins that fire wlbackorder_cart_product_not_enough_stock_message
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
ShopLentor80,000+ installs
apply_filters( 'wlbackorder_cart_product_not_enough_stock_message', $message, $product_data, $can_add_to_cart_max )includes/modules/backorder/backorder.php:193 -
ShopXpertFewer than 10 installs
apply_filters( 'wlbackorder_cart_product_not_enough_stock_message', $message, $product_data, $can_add_to_cart_max )incs/features/backorder/class.backorder.php:208
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.