WC_Order::maybe_set_date_completed
Maybe set date completed.
Sets the date completed variable when transitioning to completed status.
Method of the class: WC_Order{}
No Hooks.
Returns
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() WC Order::maybe set date completed code WC 10.6.2
protected function maybe_set_date_completed() {
if ( $this->has_status( OrderStatus::COMPLETED ) ) {
$this->set_date_completed( time() );
}
}