Automattic\WooCommerce\Internal\Admin
Events::get_note_from_db()
Get note.
Метод класса: Events{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$Events = new Events(); $Events->get_note_from_db( $note_from_db );
- $note_from_db(Note) (обязательный)
- The note object from the database.
Код Events::get_note_from_db() Events::get note from db WC 7.7.0
public function get_note_from_db( $note_from_db ) { if ( ! $note_from_db instanceof Note || get_user_locale() === $note_from_db->get_locale() ) { return $note_from_db; } $note_classes = array_merge( self::$note_classes_to_added_or_updated, self::$other_note_classes ); foreach ( $note_classes as $note_class ) { if ( defined( "$note_class::NOTE_NAME" ) && $note_class::NOTE_NAME === $note_from_db->get_name() ) { $note_from_class = method_exists( $note_class, 'get_note' ) ? $note_class::get_note() : null; if ( $note_from_class instanceof Note ) { $note = clone $note_from_db; $note->set_title( $note_from_class->get_title() ); $note->set_content( $note_from_class->get_content() ); $note->set_actions( $note_from_class->get_actions() ); return $note; } break; } } return $note_from_db; }