Automattic\WooCommerce\Internal\RestApi\Routes\V4\OrderNotes
Controller::get_order_by_note_id
Get the parent order of a note.
Method of the class: Controller{}
No Hooks.
Returns
WC_Order|null.
Usage
// protected - for code of main (parent) or child class $result = $this->get_order_by_note_id( $note_id );
- $note_id(int|WP_Comment) (required)
- The note ID or note object.
Controller::get_order_by_note_id() Controller::get order by note id code WC 10.4.3
protected function get_order_by_note_id( $note_id ) {
$note = $note_id instanceof WP_Comment ? $note_id : $this->get_note_by_id( (int) $note_id );
if ( ! $note ) {
return null;
}
return $this->get_order_by_id( (int) $note->comment_post_ID );
}