Automattic\WooCommerce\Internal\RestApi\Routes\V4\OrderNotes

Controller::get_note_by_idprotectedWC 1.0

Get a note by ID.

Method of the class: Controller{}

No Hooks.

Returns

WP_Comment|null.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_note_by_id( $note_id );
$note_id(int) (required)
The note ID.

Controller::get_note_by_id() code WC 10.4.3

protected function get_note_by_id( int $note_id ) {
	if ( ! $note_id ) {
		return null;
	}
	$note = get_comment( $note_id );
	return $note && 'order_note' === $note->comment_type ? $note : null;
}