woocommerce_email_stock_notification_button_text
Filter the button text.
Usage
add_filter( 'woocommerce_email_stock_notification_button_text', 'wp_kama_woocommerce_email_stock_notification_button_text_filter', 10, 3 );
/**
* Function for `woocommerce_email_stock_notification_button_text` filter-hook.
*
* @param string $button_text The button text.
* @param Notification $notification The notification object.
* @param WC_Product $product The product object.
*
* @return string
*/
function wp_kama_woocommerce_email_stock_notification_button_text_filter( $button_text, $notification, $product ){
// filter...
return $button_text;
}
- $button_text(string)
- The button text.
- $notification(Notification)
- The notification object.
- $product(WC_Product)
- The product object.
Changelog
| Since 10.2.0 | Introduced. |
Where the hook is called
woocommerce_email_stock_notification_button_text
woocommerce/src/Internal/StockNotifications/Emails/CustomerStockNotificationEmail.php 154
$button_text = apply_filters( 'woocommerce_email_stock_notification_button_text', _x( 'Shop Now', 'Email notification', 'woocommerce' ), $notification, $product );