Automattic\WooCommerce\Internal\OrderWithdrawal
OrderWithdrawalFeatureHighlightNotification::has_note_been_created
Whether this note has already been created, including soft-deleted notes.
Метод класса: OrderWithdrawalFeatureHighlightNotification{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->has_note_been_created(): bool;
Код OrderWithdrawalFeatureHighlightNotification::has_note_been_created() OrderWithdrawalFeatureHighlightNotification::has note been created WC 11.2.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;
}