PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Dynamically loading non-dropdown fields from another plugin's shortcode

  1. I know that fields can be dynamically populated 3 different ways.
    - Via query string (ex. domain.com/your/form?firstname=carl)
    - Via hooks using PHP
    - Via short code

    I also know I can dynamically populate dropdowns using the gform_pre_render filter, as written about in your docs (http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields).

    That said, I don't think what I know allows me to solve the problem I'm facing.

    I've developed a plugin that does URL rewriting for landing pages (called ElegantPURL - http://elegantpurl.com) and offers users an ability to use pre-established short codes that look like this: [epurl_firstname]. We also let them create additional variables for use on the landing pages, and we generate short codes for those too ([epurl_customfield]).

    I want to integrate with GravityForms but when I put [epurl_firstname] into a field's default value, it just shows up as text, rather than rendering.

    Is there a way to use the filter above (or a hook) to tell all forms (not a specific form) to look for short codes and resolve them, before rendering the form?

    Posted 11 years ago on Friday June 8, 2012 | Permalink
  2. David Peralty

    You could use the gform_pre_render hook to take some time and resolve shortcodes before pushing them to whatever form elements you want. http://www.gravityhelp.com/documentation/page/Gform_pre_render

    Posted 11 years ago on Monday June 11, 2012 | Permalink
  3. works perfectly!

    Posted 11 years ago on Thursday June 14, 2012 | Permalink