I was wondering if there is a way to use Toolset Forms to allow users to add a post to a Post Group.
Essentially, I would like them to create a post and add it to a Post Group from a list of already created Post Groups (which I will have created) without giving them access to the backend. I know how to use Toolset forms to allow them to create a new post but not sure if adding to a post group is also possible
Thanks!
Hello,
There isn't such kind of built-in feature within Toolset Forms plugin, you might consider custom codes, for example, :
1) In admin side, create a new post, and setup specific Post Group, save the post
Check your database with mysql Tool, in table wp_postmeta, search with:
post_id = your new post ID
meta_key = _wpcf_access_group
You will get one item, the meta_value is the specific Post Group's ID, something like this:
wpcf-custom-group-87e28517d9ffb821318d8c1e84684024
2) When your user submit the Toolset post form, use action hook cred_save_data to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
In this PHP function, setup the custom field "_wpcf_access_group" value to the specific Post Group's ID of step 1)
https://developer.wordpress.org/reference/functions/update_post_meta/