在WooCommerce API中创建产品时允许特定的HTML标签

时间:2019-03-14 08:26:25

标签: php woocommerce-rest-api

我正在使用C#API创建产品。到目前为止,它仍然有效,但是我的问题是,描述中的一些HTML标记已被剥离。

例如,在下面的代码中,iframe标记已删除。我们的某些产品带有视频,我希望将其包含在产品说明中。标题和段落标签等其他标签也可以使用。

    return new Product {
        // ...
        description = GetDescription(product),
        // ...
    };

    public static string GetDescription(DBProduct product)
    {
        var description = product.description;

        foreach(var video in product.videos)
        {
            description = $"<iframe width=\"1536\" height=\"760\" src=\"{video.url}\" allowfullscreen></iframe>" + description;
        }

        return description;
    }

我可以通过API创建包含其他HTML标签的产品吗?谢谢。

0 个答案:

没有答案