WordPress at Your Fingertips
function is not described

WC_Webhook_Data_Store::validate_status() private WC 3.6.0

Check if a given string is in known statuses, based on return value of @see wc_get_webhook_statuses().

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

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->validate_status( $status );
$status(string) (required)
Status to check.

Changelog

Since 3.6.0 Introduced.

Code of WC_Webhook_Data_Store::validate_status() WC 5.7.1

private function validate_status( $status ) {
	if ( ! array_key_exists( $status, wc_get_webhook_statuses() ) ) {
		throw new InvalidArgumentException( sprintf( 'Invalid status given: %s. Status must be one of: %s.', $status, implode( ', ', array_keys( wc_get_webhook_statuses() ) ) ) );
	}
}