WordPress at Your Fingertips
function is not described

WC_Order::maybe_set_date_completed() protected WC 3.0.0

Maybe set date completed.

Sets the date completed variable when transitioning to completed status.

{} It's a method of the class: WC_Order{}

No Hooks.

Return

null. Nothing.

Usage

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

Changelog

Since 3.0.0 Introduced.

Code of WC_Order::maybe_set_date_completed() WC 5.8.0

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