Skip Navigation

[Resolved] Invisible to the author of post

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

Problem:
How can I hide content from the Post Author only?

Solution:
You can use HTML conditonal as this example:

[wpv-conditional if="( '[wpv-post-author format="meta" meta="ID"]' eq '[wpv-user field="ID"]' )"]This can be seen by the Post Author:[/wpv-conditional]
 
[wpv-conditional if="( '[wpv-post-author format="meta" meta="ID"]' ne '[wpv-user field="ID"]' )"]This cannot be seen by the Post Author:[/wpv-conditional]

Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

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

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Bochnacki 7 years ago.

Assisted by: Beda.

Author
Posts
#516078

I want to put in the post an element that would be invisible to the post author.
I used

[wpv-conditional if="( '[wpv-post-author]' eq '' )" evaluate="false"]element[/wpv-conditional]

Unfortunately this shortcode does not work. The item is visible to everyone, including the author of the post.

#516170

1. I want to put in the post an element that would be invisible to the post author.

2. This means, you need to check the current User, and if this user is the Author of the current Post.

3. This is possible with conditional HTML:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

Example:

[wpv-conditional if="( '[wpv-post-author format="meta" meta="ID"]' eq '[wpv-user field="ID"]' )"]This can be seen by the Post Author:[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-author format="meta" meta="ID"]' ne '[wpv-user field="ID"]' )"]This cannot be seen by the Post Author:[/wpv-conditional]
#516212

Thanks for the help 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.