Skip Navigation

[Resolved] Form to edit last user post

This support ticket is created 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by fatios 4 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1688039

Hi everyone,

I am delighted to be new to this community!

I'm coming to you because I would like to do something that I can't do.

On my site, during their first connection, each user creates a custom post type "company" before being redirected to their dashboard.
After that, it is no longer possible for them to create another post of this type.
On their dashboard, I would like to create a "Post Form" which allows you to modify the content of the "company" post they created when they first connected.
Is there a way to do this?

I don't want to show a view of the post with an edit link (I know how to do that), I just want the form to be displayed as soon as we open the dashboard.

Perhaps it is possible to create a form allowing to modify the last post (of a specific custom post type) that the user published?

Thanks for your advices !

#1688715

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You are talking about a front-end "dashboard" page, rather than the WordPress backend dashboard, is that correct?

Showing a View of a post with an edit link is nearly the right answer.

You use a View to create the context to tell the form which post to edit. And rather than linking to the edit form in the output of the View, you can include the form itself.

So, create your View with the Query Filter required to return the correct post (e.g. display posts of the appropriate content type with a post_author filter such that the author is the same as the current user, I'm guessing that's how your set up works).

Then insert the edit form directly in the output of the View, where the context for what to edit will be the post returned by the View.

I think that is what you are aiming for, please correct me if I'm wrong.

#1690491

Thank you very much, I was not far! It's all good now 🙂