I have a website that users can create a custom information post of their own non-profit organisation. Like in every other organisation people are changing position/quit etc. When that happens I need to move ownership of a previous made custom post to an other account (custom role, created in access)
I have read some articles on the web but I have not find the right way to do it.
1. It would be nice if I can apply the feature in a custom CRED form
2. if that does not work, is there any 3d party plugin that can make it happen?
Hi,
Thank you for contacting us and I'd be happy to assist.
I'll assume, you meant changing the post author for the non-profit organization posts when someone requests a change in post ownership.
If that is correct, WordPress offers its own interface to change the post author, as explained in this guide:
hidden link
There is no built-in field in Toolset Forms to change post author through the front-end forms, so for that, you'll need some customization, involving hook like:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Hi again
Thanks for the reply.
I did not find the screen option (option in Gutenberg) author alternative. I found out a code snippet in functions.php
function studentumea_add_author_support_for_posts() {
add_post_type_support( 'post', 'author' );
}
add_action( 'init', 'studentumea_add_author_support_for_posts' );
That snippet makes the "all items" page of my custom content post look like this (image)
Then I try to change the author's name I'm ending up in a drop down list of admin accounts. I would like the users of my custom role type to show up.
Any suggestions?
Thanks for writing back.
In your custom post types registered through the Toolset Types, you can enable the support for the "Author", without the code snippet that you've shared.
You can enable it by selecting its option in the post type's settings.
( example screenshot attached )
To include users from more roles in the dropdown for the author selection, the code from this guide should work:
hidden link
My issue is resolved now. Thank you!