Skip Navigation

[Resolved] Split: cred Edit link not showing on front end user post profile, beaver themer – display edit link only for author

This support ticket is created 5 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Author
Posts
#1383753

Hi Minesh, This works, but it works all the time. When any user role with Talent is logged in, they can see that edit link on other profiles. How can I only show that for the user who's profile is current logged in user profile?

Thanks for the help!

#1383757

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can use the [wpv-conditional] shortcode to display the conditional output.

To get the current logged-in user ID, you can use the shortcode:

[wpv-current-user info="id"]

To get the current post author ID, you can use the shortcode:

[wpv-post-author format="meta" meta="ID"]'

So, to display conditional output based on current logged in user is post author, you can use the following code.

For example:

[wpv-conditional if="( '[wpv-current-user info="id"]' eq '[wpv-post-author format="meta" meta="ID"]' )"]
<p style="text-align: right;"><a class="cred-edit-post" href="/edit-talent-profile-page/?profile_id=[wpv-post-id]">Edit [wpv-post-title] </a></p>
[/wpv-conditional]

I've applied the above code where you display the edit link: hidden link

Can you please confirm it works as expected.

Please check our Docs for addtional shortcode attributes:
=> https://toolset.com/documentation/views-shortcodes/#wpv-post-author
=> https://toolset.com/documentation/views-shortcodes/#wpv-current-user