Problem:
The [wpv-conditional] shortcode doesn’t work as expected in an Events Manager template. Specifically, the condition comparing [wpv-user field="ID"] with [wpv-post-author format="meta" meta="ID"] doesn't produce output, even though their values are correct.
Solution:
The issue is caused by mixing types of quotes within the conditional statement, which can prematurely close the condition. Ensure you use:
- Double quotes for the if statement.
- Single quotes for the attributes within the shortcodes.
Updated working example:
[wpv-conditional if="( '[wpv-user field='ID']' eq '[wpv-post-author format='meta' meta='ID']' ) OR ( '[wpv-current-user info='role']' eq 'administrator' ) OR ( '[wpv-current-user info='role']' eq 'editor' )"] <a class="button" href="website">Diese Veranstaltung ändern</a> <br /> [/wpv-conditional]
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.
Ce sujet contient 6 réponses, a 3 voix.
Dernière mise à jour par Il y a 1 mois et 2 semaines.
Assisté par: Christopher Amirian.