Problem:
I've a custom post type "accommodation".
I've a field repetable group "room" taht is displayed in the accommodation page.
Each accommodation has a different author (accommodation manager role).
In mt WP backend I've add as administrator some rooms fro some accommodation.
The problem is that now I'm the author of this room and not the accommodation manager.
How can I set it?
Solution:
It is expected result, Toolset repeatable group is actually a hidden custom post type, and you are using administrator to setup the "room" item in admin side, so the "room" item author will be setup as current user: administrator.
In your case, I suggest you try these:
When you edit a single "accommodation", add/edit a room item(post), save the "accommodation" post, use WordPress action hook "save_post" to trigger a custom function, in this function update the room post's author as "accommodation" post author. For example:
https://toolset.com/forums/topic/problem-in-view-post-author/#post-1146368
Relevant Documentation:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
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 3 replies, has 2 voices.
Last updated by 6 years, 2 months ago.
Assisted by: Luo Yang.