This support ticket is created Il y a 6 années et 6 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I am using a wpv condition inside a toolset access rule and the output is messed up.
The code is inside a visual editor cel in a toolset layout.
This is the code:
[toolset_access role="Administrator" operator="allow"]
[wpv-conditional if="( $(wpcf-pdf-reader-ads) ne '' )"]
<a href="#"><div class="imgtexttest">Klik hier voor de interactieve PDF</div></a>
[/wpv-conditional]
[/toolset_access]
and this is the output (for an administrator):
<p> <a href="#"></a></p><a href="#">
<div class="imgtexttest">Klik hier voor de interactieve PDF</div>
</a><p><a href="#"></a></p>
And the "automatically instert paragraphs" for this field is turned off!
Hello. Thank you for contacting the Toolset support.
Well - I do not know why you use [toolset_access] shortcode as you can achieve this with single [wpv-conditional] shortcode and check both condition using "And"
For example:
[wpv-conditional if="( '[wpv-current-user info='role']' eq 'administrator' ) AND ( $(wpcf-pdf-reader-ads) ne '' )"]
<a href="#"><div class="imgtexttest">Klik hier voor de interactieve PDF</div></a>
[/wpv-conditional]
Wow, didn't know that you could select user roles with this...
But why not use toolset access for this? Is that a bad idea, and why? When to use toolset access?
In the meanwhile I will try to set it up like your example, but first I need your help setting this up with multiple user roles...
With toolset I used this rule:
But why not use toolset access for this? Is that a bad idea, and why? When to use toolset access?
==> Well - its bad idea as you already have conditional shortcode available that serve same purpose. you should use access shortcode when you have no conditional statement inside.
Please try to use following condition:
[wpv-conditional if="( '[wpv-current-user info='role']' eq 'administrator' ) OR ( '[wpv-current-user info='role']' eq 'klasse-1' ) OR ( '[wpv-current-user info='role']' eq 'klasse-2' ) OR ( '[wpv-current-user info='role']' eq 'klasse-4' ) AND ( $(wpcf-pdf-reader-ads) ne '' )"]
<a href="#"><div class="imgtexttest">Klik hier voor de interactieve PDF</div></a>
[/wpv-conditional]