Automattic\WooCommerce\Internal\StockNotifications
Factory::get_notification
Get the notification object.
Метод класса: Factory{}
Хуков нет.
Возвращает
Notification|bool.
Использование
$result = Factory::get_notification( $notification_id );
- $notification_id(int) (обязательный)
- Notification ID to get.
Код Factory::get_notification() Factory::get notification WC 11.2.2
public static function get_notification( int $notification_id ) {
if ( ! $notification_id ) {
return false;
}
try {
$notification = new Notification( $notification_id );
return $notification;
} catch ( \Exception $e ) {
\wc_caught_exception( $e, __FUNCTION__, array( $notification_id ) );
return false;
}
}