The gogv_shortcode_process filter exists for one purpose: to allow variables to be expanded and evaluated even in places where Gravity Forms does not support merge tags. If a shortcode supports this filter, users can wrap a variable slug inside that shortcode’s tags and the variable will still resolve correctly.
Why This Filter Exists #
Gravity Forms only supports merge tags in certain contexts. When your shortcode appears in a place where merge tags are not supported—such as in content in a regular post of page—variables would normally appear as raw slugs. This filter provides a bridge so variable expansion can still happen.
How Your Shortcode Should Integrate #
Add this check at the top of your shortcode callback, before you process $content:
$result = apply_filters( 'gogv_shortcode_process', $content );
if ( $result !== $content ) {
return $result;
}
What This Enables #
- Users can write:
[your_shortcode]{some_variable}[/your_shortcode] - Your shortcode passes
{some_variable}to the filter. - The plugin detects the variable and expands it.
- The evaluated output is returned to your shortcode.
- Your shortcode receives an already‑processed value.
If no variable is present, the filter does nothing and your shortcode continues normally.
Required Usage Pattern #
Even with the filter, the user must wrap the variable slug inside your shortcode tags:
[your_shortcode]{total_after_fees}[/your_shortcode]
This is the fallback mechanism for any environment where merge tags cannot be used.
Plan Availability #
This developer-level integration is available only on the Premium and Agency plans.
Note on Current Relevance #
With the introduction of the plugin’s own helper shortcode, most users no longer need third‑party shortcodes to integrate with this filter at all. The helper shortcode handles variable expansion globally, making the filter primarily useful for developers who want their shortcode to support variable slugs natively.
Summary #
Implementing this filter makes your shortcode compatible with Global Variables in every context—not just those where Gravity Forms supports merge tags. It ensures variables resolve cleanly anywhere your shortcode runs, keeping the user’s logic consistent across the entire site.