gwp_url
The gwp_url Merge Tag for Gravity Forms is able to return the WordPress site url, the WordPress home url, the current url, or an element of the current url.
The gwp_url merge tag has the following possible parameters:
Type parameter
The type parameter determines what url component to return. It has the following possible values:
site_url: returns the URL for the current site where WordPress application files are accessible.
home_url: Retrieves the URL for the current site where the front end is accessible (basically what users need to type in their browser url to reach your site.
scheme: returns http or https.
domain: returns the full domain or a part of it if combined with the index parameter.
path: returns the full path after domain, or a part of it when combined with the index paramater.
Index parameter
The index parameter is an optional parameter to retrieve a part of the URL-path or domain. It must be an integer value. A positive value returns the element counted from the left, starting with 0. A negative value returns the element counted from the right.
How to use the gwp_url merge tag
{gwp_url type= index=}
Examples | Output |
---|---|
{gwp_url} | https://gravitywp.com/doc/gwp_url/ |
| https://gravitywp.com |
| https://gravitywp.com |
| https |
| gravitywp.com com gravitywp |
| /docs/gwp_url/ gwp_url docs |
Last updated: 13-04-2023