woocommerce_stock_notification_status_changed │ action-hook │ WC 11.3.0

Action: woocommerce_stock_notification_status_changed

Fires after a stock notification's status is persisted with a different value, from any code path.

Usage

add_action( 'woocommerce_stock_notification_status_changed', 'wp_kama_woocommerce_stock_notification_status_changed_action', 10, 4 );

/**
 * Function for `woocommerce_stock_notification_status_changed` action-hook.
 * 
 * @param int          $notification_id The notification ID.
 * @param string       $status_from     The previous status.
 * @param string       $status_to       The new status.
 * @param Notification $notification    The notification.
 *
 * @return void
 */
function wp_kama_woocommerce_stock_notification_status_changed_action( $notification_id, $status_from, $status_to, $notification ){
	// action...
}
$notification_id(int)
The notification ID.
$status_from(string)
The previous status.
$status_to(string)
The new status.
$notification(Notification)
The notification.

Changelog

Since 11.3.0 Introduced.

Where the hook is called

StockNotificationsDataStore::update()
woocommerce_stock_notification_status_changed
woocommerce/src/Internal/DataStores/StockNotifications/StockNotificationsDataStore.php 349
do_action( 'woocommerce_stock_notification_status_changed', $notification->get_id(), $status_from, $status_to, $notification );

Where the hook is used in WooCommerce

Usage not found.