Automattic\WooCommerce\Internal\StockNotifications

Notification::has_meta_changes │ public │ WC 11.4.0

Whether any meta changes are pending a save.

Mirrors the checks in save_meta_data(), so meta marked for deletion counts, unlike get_meta_data().

Метод класса: Notification{}

Хуков нет.

Возвращает

bool.

Использование

$Notification = new Notification();
$Notification->has_meta_changes(): bool;

Список изменений

С версии 11.4.0 Введена.

Код Notification::has_meta_changes() WC 11.3.0

public function has_meta_changes(): bool {
	if ( is_null( $this->meta_data ) ) {
		return false;
	}

	foreach ( $this->meta_data as $meta ) {
		if ( is_null( $meta->value ) ) {
			if ( ! empty( $meta->id ) ) {
				return true;
			}
		} elseif ( empty( $meta->id ) || $meta->get_changes() ) {
			return true;
		}
	}

	return false;
}