Automattic\WooCommerce\Blueprint\Schemas

JsonSchema::validatepublicWC 1.0

Just makes sure that the JSON contains 'steps' field.

We're going to validate 'steps' later because we can't know the exact schema ahead of time. 3rd party plugins can add their step processors.

Метод класса: JsonSchema{}

Хуков нет.

Возвращает

true|false[.

Использование

$JsonSchema = new JsonSchema();
$JsonSchema->validate();

Код JsonSchema::validate() WC 9.9.5

public function validate() {
	if ( json_last_error() !== JSON_ERROR_NONE ) {
		return false;
	}

	if ( ! isset( $this->schema->steps ) || ! is_array( $this->schema->steps ) ) {
		return false;
	}

	return true;
}