Automattic\WooCommerce\Blocks\BlockTypes

AbstractDynamicBlock::get_schema_boolean()protectedWC 1.0

Get the schema for a boolean value.

Method of the class: AbstractDynamicBlock{}

No Hooks.

Return

Array. Property definition.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_schema_boolean( $default );
$default(string)
The default value.
Default: true

AbstractDynamicBlock::get_schema_boolean() code WC 9.4.2

protected function get_schema_boolean( $default = true ) {
	return array(
		'type'    => 'boolean',
		'default' => $default,
	);
}