Automattic\WooCommerce\StoreApi\Schemas\V1\Ucp
UcpProductSchema{}└─ ProductSchema
Product schema whose item responses carry raw strings, for the UCP catalog routes.
Agents compare titles and SKUs literally, so the storefront HTML formatter (texturized quotes, 10x20 to 10×20) would corrupt what they match on.
Хуков нет.
Использование
$UcpProductSchema = new UcpProductSchema(); // use class methods
Методы
- protected prepare_html_response( $response )
Список изменений
| С версии 11.3.0 | Введена. |
Код UcpProductSchema{} UcpProductSchema{} WC 11.3.0
class UcpProductSchema extends ProductSchema {
/**
* The schema item name.
*
* @var string
*/
protected $title = 'ucp-product';
/**
* The schema item identifier.
*
* @var string
*/
const IDENTIFIER = 'ucp-product';
/**
* Return content unformatted; the UCP mapper derives plain text itself.
*
* @param string|array $response Data to format.
* @return string|array
*/
protected function prepare_html_response( $response ) {
return $response;
}
}