Automattic\WooCommerce\StoreApi\Schemas\V1

ImageAttachmentSchema::get_properties()publicWC 1.0

Product schema properties.

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

Хуков нет.

Возвращает

Массив.

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

$ImageAttachmentSchema = new ImageAttachmentSchema();
$ImageAttachmentSchema->get_properties();

Код ImageAttachmentSchema::get_properties() WC 8.7.0

public function get_properties() {
	return [
		'id'        => [
			'description' => __( 'Image ID.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => [ 'view', 'edit' ],
		],
		'src'       => [
			'description' => __( 'Full size image URL.', 'woocommerce' ),
			'type'        => 'string',
			'format'      => 'uri',
			'context'     => [ 'view', 'edit' ],
		],
		'thumbnail' => [
			'description' => __( 'Thumbnail URL.', 'woocommerce' ),
			'type'        => 'string',
			'format'      => 'uri',
			'context'     => [ 'view', 'edit' ],
		],
		'srcset'    => [
			'description' => __( 'Thumbnail srcset for responsive images.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
		],
		'sizes'     => [
			'description' => __( 'Thumbnail sizes for responsive images.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
		],
		'name'      => [
			'description' => __( 'Image name.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
		],
		'alt'       => [
			'description' => __( 'Image alternative text.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
		],
	];
}