Shortcodes as Merge Tags

Convert shortcodes into merge tags on the fly! See usage instructions below.

Requires Gravity Forms 2.4.17.2+.

Instructions

  1. First convert your shortcode into a merge tag.

    Shortcode: [gravityforms action="remaining" id="123" input_id="4.3" limit="100"] Merge Tag: {shortcode:gravityforms&action=remaining&id=123&input_id=4.3&limit=100}

  2. Use your merge tag in as the default value in a field – or – in the GF conditional shortcode merge_tag parameter.

     [gravityforms action="conditional" merge_tag="{shortcode:gravityforms&action=remaining&id=123&input_id=4.3&limit=100}" condition="less_than" value="50"]
         Hurry! Only [gravityforms action="remaining" id="661" input_id="1.3" limit="100"] tickets left!
     [/gravityforms]
    

Code

Filename: gw-shortcodes-as-merge-tags.php

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.