Skip Navigation

[Resolved] I need to change ownership of a custom post

This support ticket is created 3 years, 10 months 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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by henrikB-3 3 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1901027

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?

#1901233

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

#1903415
Screen Shot 2021-01-13 at 06.34.46.png

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?

#1904945
post-type-edit-screen.png

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

#1905057

My issue is resolved now. Thank you!