Saltar navegación

[Cerrado] cred_show_group with shortcode

This support ticket is created hace 3 meses, 2 semanas. 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.

Este tema contiene 1 respuesta, tiene 1 mensaje.

Última actualización por Christopher Amirian hace 3 meses, 2 semanas.

Asistido por: Christopher Amirian.

Autor
Mensajes
#2792791
Screenshot 2025-01-18 at 6.20.28 PM.png

Dear Sir/Madam,

Here is a relationship between Application 1-N Contestant, I have a post to add new contestant, as post has not yet be built the relationship so I can't get the parent id or the custom field directly.

I code a shortcode to get_post_meta() and pass it to conditional group to display related field

[cred_show_group if=" [get_presentation_mode id="[wpv-search-term param="parent_vwcm-application_id"]"] eq 'online' )" mode="fade-slide"]				
[cred_field field='contestant-recording-url' force_type='field' class='form-control' output='bootstrap' placeholder="Only  Youtube URL is allowed"]
[/cred_show_group]

I am sure shortcode [get_presentation_mode id="[wpv-search-term param="parent_vwcm-application_id"]"] can return the value either 'live' or 'online', I did add the shortcode to Toolset > Setting > Front-end Content > Functions inside conditional evaluations, could you please help to explain why it doesn't work?

Best regards,

Kelvin

#2792886

Christopher Amirian
Colaborador

Idiomas: Inglés (English )

Hi Kelvin,

The idea you have seems to be correct, but I am not sure if there is a syntax problem or not.

Please test the steps below:

1. Replace the shortcode with the real value and see if the conditional works ok? Maybe also add parenthesis around the condition.

[wpv-conditional if="( '[get_presentation_mode id="DIRECT VALUE"]' eq 'online' )"]
    The value is online
[/wpv-conditional]

2. If it works see if you can add the shortcode without any attributes? Can you try that and see if it works, I feel like the "" quotes there for the shortcode cause the conflict as it closes the original if statement ". Maybe if you can use '' instead.

Thanks.

El debate ‘[Cerrado] cred_show_group with shortcode’ está cerrado y no admite más respuestas.