Hello, how is everything?
I'm creating an admin dashboard for a customer's website.
I have several forms for creating and editing posts.
In some of these forms, the admin needs to choose the author of the post, both at the time of creation and for editing. How to do this? I didn't find the author field in the form creator.
I'm waiting.
Thanks
Hello,
There isn't such kind of built-in feature within Toolset Forms plugin, you might consider custom codes, for example:
1) Add a custom select field "my-author", populate the options with user's information, see similar thread:
https://toolset.com/forums/topic/dropdown-that-shows-all-users/#post-590063
2) Put above custom select field "my-author" into your post forms
3) After user submit those post forms, use action hook "cred_save_data" to trigger a PHP function, in this PHP function:
- Get the "my-author" field value:
https://developer.wordpress.org/reference/functions/get_post_meta/
- Update the post's author value:
https://developer.wordpress.org/reference/functions/wp_update_post/
For your reference.