This support ticket is created hace 1 año, 7 meses. 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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
-
10:00 – 13:00
10:00 – 13:00
10:00 – 13:00
10:00 – 13:00
10: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/Kolkata (GMT+05:30)
Este tema contiene 4 respuestas, tiene 2 mensajes.
I've created a conditional block that checks whether the current user role is administrator or editor. However, when executed, it strips the "current user role" from the comparison per the debug:
####################
wpv-conditional attributes
####################
Array
(
[if] => ( ( '' = 'administrator' ) OR ( '' = 'editor' ) )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( ( '' = 'administrator' ) OR ( '' = 'editor' ) )
--------------------
After replacing 1 general variables and comparing strings: ( ( '' = 'administrator' ) OR ( '' = 'editor' ) )
Comparing to administrator
After replacing 2 general variables and comparing strings: ( ( '' = 'administrator' ) OR ( '' = 'editor' ) )
Comparing to editor
Switching to the advanced conditional editor on the block didn't help. I also tried using a content template block with the same conditionals in the content template classic editor:
[wpv-conditional if="( '[wpv-current-user info="role"]' eq 'administrator' ) OR ( '[wpv-current-user info="role"]' eq 'editor' )" debug="true"]
MY CONTENT
[/wpv-conditional]
The debug information remains the same. Any ideas why [wpv-current-user info="role"] is getting stripped out of the expression?
Hello. Thank you for contacting the Toolset support.
First of all, based on the debug information you shared I find that you are using the outdated Toolset plugins. We always recommend running your site with the latest stable release plugin version.
*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
OR
You can install/update Toolset plugins using the installer plugin:
-https://toolset.com/faq/how-to-install-and-register-toolset/#automatic-installation-once-you-have-otgs-installer-plugin-installed
Once you update all Toolset plugins to latest release - Can you please make sure you are checking the condition where you already loggedin?
If it does not work - please share problem URL where you added the conditional statement as well as admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Do you see any reason why this conditional runs correctly for you and my admin user account, but not for the admin user Kayla? The debug is still running as blank when she is logged in. She's the user who created the page and conditional block, if that makes a difference.