Skip Navigation

[Resolved] Best approach to have special users (owners) possible to edit them listing

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

Problem:

Allow users to see the edit link of their own posts.

Solution:

In order to achieve this you will need to make use of our conditional shortcode to wrap your edit link shortcode inside the conditional.

Here is the conditional below that you will need to use.

[wpv-conditional if="('[wpv-current-user info='id']' eq '[wpv-post-author meta='ID']')"]
Edit Post link goes here
 
[/wpv-conditional]

Essentially this is checking if the ID of the currently logged in user is the same as the author of the current post being viewed.

Once both IDs are the same then the text "Edit Post link goes here" will display. You will need to replace this text with the actual shortcode of the edit link.

This support ticket is created 3 years, 8 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.

Our next available supporter will start replying to tickets in about 0.91 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by simonV-3 3 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#1966605

Tell us what you are trying to do? Here hidden link I have already a register form and this works well - this is for normal users.

A next step is to have owners from listings. Meaning, other user roles and able to edit a listing where they are matched together. What could be a best approach to do so?

In the beginning the matching might be done manually - in a later step - so far automatically but always with approve that the user is eligible to edit the listing he signed up for it.

Is there any documentation that you are following? I not following yet a document, but was thinking to create somehow a relationship between the listings and the users with the correct user roles.

Is this basically possible?

Is there a similar example that we can see?

What is the link to your site?

#1966905

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Simon,

Can you provide a bit of clarity on the statement below.
Meaning, other user roles and able to edit a listing where they are matched together. What could be a best approach to do so?

Right now we have a way to allow only the Authors of the post to edit it. However given your case you want users who are assigned to a listing to be allowed to edit it ?

Some further clarification on the scope is needed, perhaps providing an example as well.

Thanks,
Shane

#1966927

Dear Shane

Those "superusers" will get or will be then authors of the listing - so a one - to - one relationship, once they are approved.

I can think of, that they request to be an owner (author) - we do check manually if they are eligible to manage the listing, then we add or change them as author of the specific listing.

Regards,

Simon

#1967299

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Simon,

Given that they will be set as the authors of the listing then you can employ our conditional shortcode to get this working.

Here is an example below.


[wpv-conditional if="('[wpv-current-user info='id']' eq '[wpv-post-author meta='ID']')"]
Edit Post link goes here

[/wpv-conditional]

The code above will check if the currently logged in user has the same ID of the current post being viewed and then display any content you add within the conditional.

Thanks,
Shane

#1968071

My issue is resolved now. Thank you!