Skip Navigation

[Resolved] Have user edit their custom post type based on author

This support ticket is created 5 years, 5 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Beda 5 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#1296583

Tell us what you are trying to do?
I am trying to have a user be able to edit an existing post when they go to their profile page (the post is a cpt that acts as their profile).

I have setup a view that filters by post author, so it shows their preexisting post information, and if they don't have any information, it will then show them the CRED form to fill in and submit to create their post.

This keeps them from creating more than one post, as they will see their existing post rather than the new post submission form.

I now would like to instead of displaying their completed post's information in the view, I would like to use the CRED form, but have it be editing the preexisting post they had already created, i.e. already filled in with their other information, and submitting only saves changes, but does not submit a new post. Is this possible through Toolset?

An alternative is to have the view display their post's information like I am currently doing, but I am unsure how to:
1.) place an 'edit" button next to the post result so they can click it and edit that prexisting profile/post.
2.) have the results for checkboxes be returned as text, instead of a numeric value. I'm guessing I would need to edit the custom fields, and manually change the values for each checkbox choice to match it's english-name?

Thank you for your guidance. If it's easier to login and see the site just let me know and I'll share access.

#1296585
instruments taught view.png
instruments taught view code.png
instruments taught fields.png

Regarding "2.) have the results for checkboxes be returned as text, instead of a numeric value. I'm guessing I would need to edit the custom fields, and manually change the values for each checkbox choice to match it's english-name?"

I am noticing that when I display the results of the check boxes for a custom post type, it is returning the "value" 1.

I want it to show "guitar, vocals, etc"

I added screenshots to share what I've done so far.

Thank you. If this should be another ticket, we can drop it and I'll open a new ticket for the checkbox concern.

#1296611

I figured out the checkboxes, I had to recreate my old posts after adding the correct field values.

I only need help with the original cred/teacher profile issue at this point.

#1296697

1. I now would like to instead of displaying their completed post's information in the view, I would like to use the CRED form, but have it be editing the preexisting post they had already created, i.e. already filled in with their other information, and submitting only saves changes, but does not submit a new post. Is this possible through Toolset?

Sure, this would be an edit form
You'd simply set a Toolset Form to edit instead of adding new posts and use that form. It'll only allow editing, never to create new posts.

2. place an 'edit" button next to the post result so they can click it and edit that preexisting profile/post.

You'd simply put a Forms Post Edit Link on either the single post or the View which lists all those posts.
That is shown here: https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

3. have the results for checkboxes be returned as text, instead of a numeric value. I'm guessing I would need to edit the custom fields, and manually change the values for each checkbox choice to match it's english-name?

This is a new question not related to editing or new post forms, it is related about how you can show Fields created in Types, and eventually edited in Forms, yes, but the display is done with Types/Views methods.
You will see numbers because you set numbers as values in the checkboxes field when creating it with Types in Toolset > Post Fields.
If you change those values you will see them in the front end too.
Or, you can display custom values (this is set when you actually insert the ShortCode to display those fields) for each checked or not checked option.
https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes

As you correctly recognized old posts will need to be updated if you change those values.

Please, can you open a new ticket for this issue, if anything about it remains unclear?

If related the issue about editing/creating posts there are questions left, please let me know in this ticket 🙂

#1298125

My issue is resolved now. Thank you!

#1298137

I setup an edit post link, but I cannot get it to show when using the view on the page.

Can you tell by looking at my code and results what may be the issue? Thanks Beda for your help.

I got an http error trying to upload the screenshots, you should be able to see them here:
hidden link

#1298139

Reopening.

#1298355

You seem to have inserted the Posts Edit Link, which will lead to the backend of the very page/post, but you mentioned you want a Form, and that is not how a Forms edit link is displayed.

For that, you would use the Forms Button (where you add forms) and choose the Edit Link.
Then you'll have to go thru a few setup steps and will then be able to insert the link that leads to the form to edit this Post

Can you try this?