Skip Navigation

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

This thread is resolved. Here is a description of the problem and solution.

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 4 years, 5 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
- 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)

This topic contains 4 replies, has 3 voices.

Last updated by lanaG 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#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 🙂