Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFeatureHighlightNotification::possibly_add_note │ public │ WC 1.0

Add the note if the store is eligible and it has never been created before.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$OrderWithdrawalFeatureHighlightNotification = new OrderWithdrawalFeatureHighlightNotification();
$OrderWithdrawalFeatureHighlightNotification->possibly_add_note(): void;

Код OrderWithdrawalFeatureHighlightNotification::possibly_add_note() WC 11.2.2

public function possibly_add_note(): void {
	try {
		if ( $this->has_note_been_created() ) {
			return;
		}

		if ( ! $this->is_applicable() ) {
			return;
		}

		if ( ! add_option( self::CREATED_OPTION, 'yes', '', false ) ) {
			return;
		}

		$this->get_note()->save();
	} catch ( Exception $exception ) {
		delete_option( self::CREATED_OPTION );
		wc_get_logger()->error(
			'Unable to create the order withdrawal inbox notification.',
			array(
				'source'    => 'order-withdrawal',
				'exception' => $exception,
			)
		);
	}
}