Automattic\WooCommerce\Admin\API

PaymentGatewaySuggestions::get_item_schema()publicWC 1.0

Get the schema, conforming to JSON Schema.

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

No Hooks.

Return

Array.

Usage

$PaymentGatewaySuggestions = new PaymentGatewaySuggestions();
$PaymentGatewaySuggestions->get_item_schema();

Code of PaymentGatewaySuggestions::get_item_schema() WC 7.1.0

public function get_item_schema() {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'payment-gateway-suggestions',
		'type'       => 'array',
		'properties' => array(
			'content'                 => array(
				'description' => __( 'Suggestion description.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'id'                      => array(
				'description' => __( 'Suggestion ID.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'image'                   => array(
				'description' => __( 'Gateway image.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'is_visible'              => array(
				'description' => __( 'Suggestion visibility.', 'woocommerce' ),
				'type'        => 'boolean',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'plugins'                 => array(
				'description' => __( 'Array of plugin slugs.', 'woocommerce' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'recommendation_priority' => array(
				'description' => __( 'Priority of recommendation.', 'woocommerce' ),
				'type'        => 'integer',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'title'                   => array(
				'description' => __( 'Gateway title.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		),
	);

	return $this->add_additional_fields_schema( $schema );
}