WC_Abstract_Order::is_valid_status │ public │ WC 11.3.0

Whether the order can have a status.

Method of the class: WC_Abstract_Order{}

No Hooks.

Returns

bool.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->is_valid_status( $status ): bool;
$status(string) (required)
Status slug, with or without the wc- prefix.

Changelog

Since 11.3.0 Introduced.

WC_Abstract_Order::is_valid_status() code WC 11.3.0

public function is_valid_status( string $status ): bool {
	return in_array( 'wc-' . OrderUtil::remove_status_prefix( $status ), $this->get_valid_statuses(), true );
}