Skip Navigation

[Résolu] How can i add toolset shortcode in gravity form text field as a default value

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

Add toolset shortcode in gravity form text field as a default value

Solution:

It depends on gravity form plugin, Toolset Types/Views shortcodes are also using WP function add_shortcode() to register shortcodes, so if other shortcodes work in gravity form plugin, Toolset Types/Views shortcodes should be able too.

For example:

https://toolset.com/forums/topic/how-can-i-add-toolset-shortcode-in-gravity-form-text-field-as-a-default-value/#post-1713425

Relevant Documentation:

https://developer.wordpress.org/reference/functions/add_shortcode/

This support ticket is created Il y a 4 années et 4 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 4 réponses, a 3 voix.

Dernière mise à jour par lanaG Il y a 4 années et 4 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1713381

How can i add toolset shortcode in gravity form text field as a default value

#1713425

Hello,

It depends on gravity form plugin, Toolset Types/Views shortcodes are also using WP function add_shortcode() to register shortcodes, so if other shortcodes work in gravity form plugin, Toolset Types/Views shortcodes should be able too.

For example, you can create a simple shortcode:

add_shortcode( 'my-shortcode', 'my_shortcode_func' );
function my_shortcode_func( $atts, $content ) {
    return "It is my shortcode";
}

Then use above shortcode [my-shortcode] in gravity form plugin plugin, if it does not work too, you will need to check gravity form support.

More help:
https://developer.wordpress.org/reference/functions/add_shortcode/

#1714357

I will ask the guys from gravity forms. Thanks a lot!

#1743797

Hi marcB-6 - I'm doing the same thing with Gravity and Types now too.

Could you please let me know if / how you got it working please?

Thanks so much

#1743809
Screen Shot 2020-08-19 at 1.41.01 pm.png

Don't worry I got it working 🙂