Automattic\WooCommerce\Admin\API

MarketingChannels::get_item_schema()publicWC 1.0

Retrieves the item's schema, conforming to JSON Schema.

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

Хуков нет.

Возвращает

Массив. Item schema data.

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

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

Код MarketingChannels::get_item_schema() WC 9.3.3

public function get_item_schema() {
	$schema = [
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'marketing_channel',
		'type'       => 'object',
		'properties' => [
			'slug'                    => [
				'description' => __( 'Unique identifier string for the marketing channel extension, also known as the plugin slug.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'name'                    => [
				'description' => __( 'Name of the marketing channel.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'description'             => [
				'description' => __( 'Description of the marketing channel.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'icon'                    => [
				'description' => __( 'Path to the channel icon.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'is_setup_completed'      => [
				'type'        => 'boolean',
				'description' => __( 'Whether or not the marketing channel is set up.', 'woocommerce' ),
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'settings_url'            => [
				'description' => __( 'URL to the settings page, or the link to complete the setup/onboarding if the channel has not been set up yet.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'product_listings_status' => [
				'description' => __( 'Status of the marketing channel\'s product listings.', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
			'errors_count'            => [
				'description' => __( 'Number of channel issues/errors (e.g. account-related errors, product synchronization issues, etc.).', 'woocommerce' ),
				'type'        => 'string',
				'context'     => [ 'view' ],
				'readonly'    => true,
			],
		],
	];

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