Skip Navigation

[Resolved] How to add condition for loggedin users in conditional block

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

This topic contains 4 replies, has 2 voices.

Last updated by nicolaS-3 2 years, 6 months ago.

Author
Posts
#2355221

Hi
pls let me know how to add a condition for loggedin users in conditional block. I tried this
( ( '[wpv-current-user info="id"]' eq 'logged_in' ) AND ( '[wpv-post-field name="user-status" ]' eq '1' ) ) but it doesn't work.
If in the advanced editor I add
( '[wpv-current-user info='logged_in']' eq 'true' )
after saving it's automatically changed into
( '[wpv-current-user info="id"]' eq 'true' ) that doesn't work either.
Please explain.
thanks
Nicola

#2355293

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2022-05-04 at 12.05.17.png

Hi there

I just used the conditional block to check that the current user id wasn't empty—which works as expected. Switching to the Advanced editor it showed the generated condition as

 NOT ( empty( '[wpv-current-user info="id"]') ) 
#2355371

Hi Nigel, sorry but I don't understand, it looks like your reply is for another ticket. How did you check it ? or please explain thanks

#2355405

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You want to add a conditional block that checks if the user is logged in, correct?

The screenshot in my reply shows the condition that you can use to do that.

(The expression shared in the text is what is shown if you switch to the Advanced editor, though you wouldn't need to do that.)

#2356115

Hi Nigel, it works ! Thank you!