Automattic\WooCommerce\Internal\Admin\Notes

OrderMilestones::can_be_added()publicWC 1.0

Checks if a note can and should be added.

{} Это метод класса: OrderMilestones{}

Хуков нет.

Возвращает

true|false.

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

$OrderMilestones = new OrderMilestones();
$OrderMilestones->can_be_added();

Код OrderMilestones::can_be_added() WC 6.9.4

public function can_be_added() {
	// If the milestone notes have been disabled via filter, bail.
	if ( ! $this->are_milestones_enabled() ) {
		return false;
	}

	$last_milestone    = $this->get_last_milestone();
	$current_milestone = $this->get_current_milestone();

	if ( $current_milestone <= $last_milestone ) {
		return false;
	}

	return true;
}