最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

woocommerce offtopic - Set Post Thumbnail to external URL

programmeradmin0浏览0评论

This question is with regard to feature images on WooCommerce product post types, however it should probably apply to any post type.

I am running a custom script to create new posts (of type product) and want to set the featured image to be an external URL, rather than importing the images to my server as the images are already served via CDNs.

A normal featured image sets _thumbnail_id in the wp_postmeta table, and the meta_value column then references the image details on wp_posts. Whilst I can probably manually create these database entries, I am wondering if there is a WordPress function to do this that I don't know about.

I'm looking for a programatic solution rather than any plugin suggestions.

发布评论

评论列表(0)

  1. 暂无评论