Skip Navigation

[Resolved] cred edit form outputs literal shortcode inside conditional

This support ticket is created 5 years, 6 months ago. 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
- 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)

This topic contains 5 replies, has 2 voices.

Last updated by Nicholas 5 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1135721

I am trying to add a cred edit form to a product page like so:

[wpv-conditional if="( '[wpv-post-status]' eq 'draft' )"]
[cred_form form='campaign-form-publish']-
[/wpv-conditional]

However, this just outputs the literal shortcode when the product is still a draft

I put this inside a content template and I am also using the layouts plugin.

This is for product pages so woocommerce views is involved too.

Do you mind testing this out on your end?

When I remove the conditional sentence the form is displayed properly.

Please help. Do you also get the literal shortcode?

I use the latest versions of the toolset plugins.

Regards,
Nick

#1136034

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - could you please share screenshot of your layouts page where you added above conditional shortcode ?

#1136040
Screen Shot 2018-10-29 at 14.36.22.png

Yes in the meantime do you mind testing it out on your end?

Do you see the shortcode in the screenshot? This is on the layouts page. In the screenshot ou see the content template added to the layout. there's only one added.

[wpv-conditional if="( '[wpv-post-status]' eq 'draft' )"]
[cred_form form='campaign-form-publish']</div>
[/wpv-conditional]

#1136049

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I just tested it and it just works fine.

I've just replace the my test form within the conditional statement and it just rendered fine:

[wpv-conditional if="( '[wpv-post-status]' eq 'draft' )" debug="true"]
[cred_form form="create-new-state-form"]
[/wpv-conditional]
#1136075

This is what I got

####################
wpv-conditional attributes
####################
Array
(
[if] => ( draft' = 'draft' )
[debug] => true
)

####################
Debug information
####################
--------------------
Original expression: ( draft' = 'draft' )
--------------------

Can I give you access to my site?

#1136079

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - sure.

Please share problem URL and access details.

I have set the next reply to private which means only you and I have access to it.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.