WC_Order::maybe_set_date_completed()protectedWC 3.0.0

Maybe set date completed.

Sets the date completed variable when transitioning to completed status.

Method of the class: WC_Order{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->maybe_set_date_completed();

Changelog

Since 3.0.0 Introduced.

WC_Order::maybe_set_date_completed() code WC 8.7.0

protected function maybe_set_date_completed() {
	if ( $this->has_status( 'completed' ) ) {
		$this->set_date_completed( time() );
	}
}