Skip Navigation

[Resolved] Forms for editing existing content.

This thread is resolved. Here is a description of the problem and solution.

Problem:

Display the edit link for the post author only.

Without an edit link being on the page permanently for all other website users, and without user being logged in to the site, is this possible?

Solution:

you can use shortcode [wpv-conditional] to check if it is post's author, then display the edit link, for example:

https://toolset.com/forums/topic/forms-for-editing-existing-content/#post-1155213

Relevant Documentation:

https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-conditional

This support ticket is created 6 years 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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 5 years, 12 months ago.

Assisted by: Luo Yang.

Author
Posts
#1154767

We have client profile pages like this - hidden link

What would the best way to set up an edit content form?

Without an edit link being on the page permanently for all other website users, and without user being logged in to the site, is this possible?

#1155213

Hello,

I have checked the URL you mentioned above, it is displaying 504 error, please check it.
hidden link

I assume assume you are going to display the edit link for the post author only.

If it is, it is possible, you can use shortcode [wpv-conditional] to check it is post's author, then display the edit link, for example:

[wpv-if evaluate="'[wpv-current-user info='id']' = '[wpv-post-author format='meta' meta='ID']' OR '[wpv-current-user info='role']' = 'administrator'"]
    //here display the edit link
[/wpv-if]

Above codes will display the edit link for post's author and site administrator only.

More help:
hidden link

#1158619

Does this mean the user has to be logged in to edit?

#1158621

Yes, you are right, the user has to be logged in to edit, or we don't know if he is the post's author

#1158643

My issue is resolved now. Thank you!

#1159179

You are welcome