Automattic\WooCommerce\Internal\Admin\Notes

OrderMilestones::get_note_by_milestone()public staticWC 1.0

Get the note by milestones.

Method of the class: OrderMilestones{}

No Hooks.

Return

Note.

Usage

$result = OrderMilestones::get_note_by_milestone( $current_milestone );
$current_milestone(int) (required)
Current milestone.

OrderMilestones::get_note_by_milestone() code WC 7.1.0

public static function get_note_by_milestone( $current_milestone ) {
	$content_data = (object) array(
		'current_milestone' => $current_milestone,
	);

	$note = new Note();
	$note->set_title( self::get_note_title_for_milestone( $current_milestone ) );
	$note->set_content( self::get_note_content_for_milestone( $current_milestone ) );
	$note->set_content_data( $content_data );
	$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
	$note->set_name( self::NOTE_NAME );
	$note->set_source( 'woocommerce-admin' );
	$note_action = self::get_note_action_for_milestone( $current_milestone );
	$note->add_action( $note_action['name'], $note_action['label'], $note_action['query'] );
	return $note;
}