Skip Navigation

[Resolved] In the post creation/editing form, choose the author

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years ago.

Assisted by: Luo Yang.

Author
Posts
#2246209

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

#2246591

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.