Skip Navigation

[Resolved] Split: show content if the current user is the author or the payee

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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year, 7 months ago.

Assisted by: Waqar.

Author
Posts
#2620693

Great, Waqar!

Now I have another thing to do. This list must show lines if the current user is the author or if it is the payee.

I have attached the prints of the view configuration, the page and the result.

Theoratically I need to use the filters post_author OR payeeid, but I think it is still tryng an AND.

#2620697

Hi,

The conditional statement for this case will look like this:
( ref: https://toolset.com/documentation/legacy-features/views-plugin/nesting-and-combining-conditions/ )


[wpv-conditional if="( '[wpv-current-user info='id']' eq '[wpv-post-author format='meta' meta='ID']' ) OR ( '[wpv-current-user info='id']' eq '[types field='payeeid' ][/types]' ) "] 

Show this content only if the current user is the post author or the Payee

[/wpv-conditional]

The content inside the conditional statement will only show if the currently logged-in user's ID is either equal to the current post's author ID or the User ID that is saved in the custom field 'payeeid'.

Note: Please replace 'payeeid' with the actual slug of the custom field used on your website.

regards,
Waqar