Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFeatureHighlightNotification::has_note_been_created │ private │ WC 1.0

Whether this note has already been created, including soft-deleted notes.

Method of the class: OrderWithdrawalFeatureHighlightNotification{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->has_note_been_created(): bool;

OrderWithdrawalFeatureHighlightNotification::has_note_been_created() code WC 11.1.2

private function has_note_been_created(): bool {
	if ( 'yes' === get_option( self::CREATED_OPTION, 'no' ) ) {
		return true;
	}

	/**
	 * Data store instance.
	 *
	 * @var NotesDataStore $data_store
	 */
	$data_store = Notes::load_data_store();
	$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );

	if ( empty( $note_ids ) ) {
		return false;
	}

	update_option( self::CREATED_OPTION, 'yes', false );

	return true;
}