Saltar navegación

[Resuelto] Show text to specific user and admin

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

I tried the solution proposed in the ticket above but unfortunately it didn't work. When I applied it the text didn't show at all to any role/user. I have included the code that I added below would it be possible to take a quick look and confirm what i'm doing wrong! Just

Solution:

There is a missing "(" in your codes, please replace it with below, and test again:

https://toolset.com/forums/topic/show-text-to-specific-user-and-admin/#post-1809927

Relevant Documentation:

This support ticket is created hace 4 años, 9 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.

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 -

Zona horaria del colaborador: Asia/Hong_Kong (GMT+08:00)

Etiquetado: 

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por stewartE hace 4 años, 9 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1808601
cond.png

https://toolset.com/forums/topic/show-text-to-specific-user/

Apologies for the delay in response. I tried the solution proposed in the ticket above but unfortunately it didn't work. When I applied it the text didn't show at all to any role/user. I have included the code that I added below would it be possible to take a quick look and confirm what i'm doing wrong! Just to recap I am trying to wrap a piece of text in conditional code so that it is only visible to one specific user plus admin and editors should also be able to see it. Thanks!

<wpv-loop>

  • [wpv-post-body view_template="loop-item-in-td-quick-links"]
  • </wpv-loop>

    <!-- wpv-loop-end -->
    [wpv-conditional if="( '[wpv-current-user info="login"]' eq 'example@example.com' ) OR ( '[wpv-current-user info="role"]' eq 'editor' ) OR ( '[wpv-current-user info="role"]' eq 'administrator' ) )"]TEXT HERE[/wpv-conditional]

    [/wpv-items-found]
    [wpv-no-items-found]
    [wpml-string context="wpv-views"]No items found[/wpml-string]
    [/wpv-no-items-found]
    [wpv-layout-end]

    #1809927

    Hello,

    Thanks for the details, there is a missing "(" in your codes, please replace it with below, and test again:

    [wpv-conditional if="( ( '[wpv-current-user info="login"]' eq 'example@example.com' ) OR ( '[wpv-current-user info="role"]' eq 'editor' ) OR ( '[wpv-current-user info="role"]' eq 'administrator' ) )"]
    TEXT HERE
    [/wpv-conditional]
    
    #1810161

    My issue is resolved now. Thank you!