Support,
Right now I am inputting external URL's into custom fields to pull product images. Is it possible to trigger the featured image of a post from the custom field?
Thanks,
Charles
Dear Charles,
I assume we are talking about this case, when user save a post, you are going to use the custom image field value as the post feature image(product image).
If it is, there isn't such a built-in feature within Toolset.
It needs custom codes, here are my suggestion:
1) When user save the post, you can use action hook save_post to trigger a PHP function
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
2) In this function
- Get the custom image field value
https://codex.wordpress.org/Function_Reference/get_post_meta
- Retrieve the remote image file
hidden link
- Save it into wordpress media library
https://codex.wordpress.org/Function_Reference/wp_insert_attachment
- Save the media ID as post feature image(product image)
https://codex.wordpress.org/Function_Reference/set_post_thumbnail
But according to our support policy
https://toolset.com/toolset-support-policy/
this kind of custom codes is out the range of Toolset support, if you need assistance for it, you might check it with our Toolset contractors:
https://toolset.com/contractors/