Greetings. I noticed that currently toolset does not support filtering by post type by default. So I want to create a feature that uses the post type's custom field to filter specific post types. To achieve this, I need to synchronize the post type into a custom field. The post types include product, artwork, and creator. Since the post type does not change, I would like the synchronization to happen during the initial creation of the post, avoiding repeated execution during subsequent saves or updates.
I have attempted to use the save_post hook to synchronize the post type data of already created posts into a custom field. However, the code did not work during testing. I suspect the issue might be related to configuration problems or the failure to update the custom field properly.
Hello. Thank you for contacting the Toolset support.
As I understand - you want to assign/setup custom field value for the custom field "wpcf-post-type" for the existing posts? if that correc?
OR
your aim is to setup custom field value for the custom field "wpcf-post-type" automatically whenever user add/edit the post.
Thanks for your response.
Mainly I want to setup custom field value for the custom field "wpcf-post-type" automatically whenever user add/edit the post. However, I do not wish to create many new posts for testing the filter function.
So I need both functions.
With "Custom Field Content" column you setup values as Products, Artworks and Creators. You can change the "Dispaly Text" column as Products, Artworks and Creators.
Can you please modify "Custom Field Content" column values as product, artwork and creator and then save your custom field and then try to add new post with correct values and save and try to edit - it should work.