Skip Navigation

[Resolved] Authors creating their own content

This support ticket is created 5 years, 2 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1379229
siteground.PNG

Hi there,

I'm wondering if it's possible to automatically link an author on my site to a post, within a custom post type.

So I'm creating a site where trainers create their own blogs and events. Besides the blogs and events being custom post types, there's also a custom post type for the trainers themselves. When the trainer is logged in and fills in the Toolset form in order to create a blog or event, he/she has to link these post to his/her trainer profile (which is also a post within a custom post type). The problem is that it will become very messy when a lot of trainers are on the platform. It would be much easier if the blogs and events will automatically be assigned to the trainer profile.

Can you tell me how I can pull this of? I'll upload a screenshot of how it looks now.

Greetings

#1379501

Hello, it might be possible to set a default value for this input field and then hide it using CSS. You would need a way to get the User's Trainer post ID. Then you could put that ID in the default value of the parent field.

The critical problem is how to access that User's Trainer post ID. Sometimes it requires a custom shortcode, depending on how the Trainer post and User are related. Can you tell me more about that?

If you're comfortable writing custom code, then you could use the cred_save_data hook and the toolset_connect_posts API to programmatically link these two posts. You would remove the parent field from the Form in this case, and it would be automated. I have documentation about those APIs available if you're interested:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts

#1379923

Thanks for the explanation.

I think I don't quite get your question. For every User, there will be one Trainer post. But every trainer post can be linked to multiple posts within the post type "Events" and "Blogs".

Is there a workaround without writing custom code? Unfortunately, I'm not comfortable writing code.

#1379997

I'm sorry bro. With all due respect; Call me suspicious but I really don't want to be helped by you. I really, really didn't like our previous conversation, and it makes me feel unease when dealing with this now. I prefer being helped by someone else. I'm going to close this ticket and start a new one.

Have a nice day!

#1379999

.