Problem:
I want to have a Post Edit Form on the Front End that lets users edit a post of their choice (usually, there will be a link on a single post saying "Edit this post" and if clicked, it'll lead to the Post Edit Form).
The Form, however, should be on a page, and only the form should be seen, no other post data around it.
I can hence not insert the Edit Form in the Post itself, or link to it the classic Toolset way, as that would show the Form within the single Post.
Solution:
You can do this by altering the ShortCodes of Toolset Forms when inserting them.
1. Head into a Content Template or any backend text editor and insert the Edit Form you created - using the Toolset "Forms" Toolbar Button. You will set the Form to edit a specific Post when inserting this ShortCode. Pass any Post you want, it does not matter just yet which post it is, important is to tell the form to edit a specific post.
You will receive a ShortCode like this:
[cred_form form='edit-vendor-listing-post-form' post='1369']
2. Now, replace 1369 (which is the post ID of any random post we selected to edit in the Form's ShortCode), with the URL parameter ShortCode that Toolset offers in the "Fields and Views" Toolbar Button: [wpv-search-term param="your_term"]
"your_term" here is any term of your choice, that you will later use to tell the Form what post to edit.
You will remain with something like this:
[cred_form form='edit-vendor-listing-post-form' post='[wpv-search-term param="your_term"]']
3. This ShortCode can now be inserted in the Page where you want this Form to edit posts.
4. In the single post template or any loop of posts, you can now insert a Custom HTML Link that links to the above-created page, with the form.
The HTML link should look similar to this:
Edit This Post
5. This will now create a Link, which leads to our page (page-with-edit-form) where the Edit Form is, and it passes the Post ID to edit in the URL parameter your_term. This Parameter is dynamically populated with the Post ID you currently see.
6. Hence, now you can head to any post or view loop (in the front end) where you inserted that link, click on "Edit This Post", this will lead you to some URL like https://site.com/page-with-edit-form/?your_term=1369, which is the Page with the Form that lets you edit that post (1369)
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)
This topic contains 12 replies, has 2 voices.
Last updated by 5 years, 5 months ago.
Assisted by: Beda.