Tell us what you are trying to do?
I'm trying to create a button that is visible to logged in users only that allows custom post types to be claimed by a registered user. Using the link below, I do have the button working properly. When another user clicks on the "Claim Now" button it does change the author of the post to the user who clicked it. However; I need that button to disappear once the post has been claimed by anyone other than the administrator.
Is there any documentation that you are following?
I have been following this link:
https://toolset.com/forums/topic/how-to-create-a-claim-function-with-admin-approval/
Is there a similar example that we can see?
What is the link to your site?
beta.iwebnow.net
Hi Joshua,
Thank you for contacting us and I'd be happy to assist.
You can use the "wpv-post-author" shortcode, to get the "user_level" of the post's author:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-post-author
[wpv-post-author format='meta' meta='user_level']
By default, only the users with the "administrator" role will have "user_level" equal to "10".
This shortcode can be used in a conditional code block so that the claim now button is only visible when that value is not equal to 10.
( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/ )
[wpv-conditional if="( '[wpv-post-author format='meta' meta='user_level']' ne '10' )"]
Claim now button's code
[/wpv-conditional]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar