Automattic\WooCommerce\Internal\Admin

OrderMilestoneEasterEgg::update_milestones_complete_optionprivateWC 1.0

Updates the complete option when all milestone IDs have been found.

Method of the class: OrderMilestoneEasterEgg{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->update_milestones_complete_option( $milestone_order_ids ): void;
$milestone_order_ids(array) (required)
.

OrderMilestoneEasterEgg::update_milestones_complete_option() code WC 10.9.1

private function update_milestones_complete_option( array $milestone_order_ids ): void {
	if ( count( $milestone_order_ids ) === count( self::MILESTONE_POSITIONS ) ) {
		update_option( self::MILESTONES_COMPLETE_OPTION, 'yes', false );
		return;
	}

	delete_option( self::MILESTONES_COMPLETE_OPTION );
}