Included Shortcodes

The Dynamic Text Extension includes some shortcodes out of the box to make it easy to get started with the most common use cases.

PHP GET Variables

CF7_GET key='foo'

This shortcode gives you access to the PHP GET variables, i.e. the arguments in the query string.

Example

To get the foo argument from the URL https://mysite.com?foo=bar

You would use the shortcode

CF7_GET key='foo'

in a dynamic text tag:

[dynamictext inputname "CF7_GET key='foo'"]

PHP POST Variables

CF7_POST key='foo'

Provides access to the PHP $_POST variables array by key.

Example

[dynamictext inputname "CF7_POST key='foo'"]

Blog/Site Info

CF7_bloginfo show='url'

Provides access to the basic site info from the get_bloginfo() function.

Examples

Dynamic Text tag:

[dynamictext inputname "CF7_bloginfo show='url'"]

Shortcode variations:

CF7_bloginfo show='name' Site Title
CF7_bloginfo show='url' Site URL
CF7_bloginfo show='version' WordPress version

Post Info

CF7_get_post_var key='title'

Provides access to information about the current post/page that the form is displayed on based on the properties of the current global $post object.

Example

Dynamic Text tag:

[dynamictext inputname "CF7_get_post_var key='title'"]

Shortcode variations:

CF7_get_post_var key='title' Current post title
CF7_get_post_var key='slug' Current post slug
CF7_get_post_var key='post_author' Current post author’s ID

Current URL

CF7_URL

Returns the current URL of the page the form is on. Shortcode does not have any arguments.

Example

Dynamic Text tag:

[dynamictext inputname "CF7_URL"]

Custom Fields

CF7_get_custom_field key='my_custom_field'

Access custom meta fields from the current post/page. Use the custom field’s ID as the key.

Example

Dynamic Text tag:

[dynamictext inputname "CF7_get_custom_field key='my_custom_field'"]

Current User Info

CF7_get_current_user key='user_field'

Access current user’s info based on wp_get_current_user()

If no key is provided, will default to user_login.

Example

Dynamic Text tag:

[dynamictext inputname "CF7_get_current_user key='user_nicename'"]

Shortcode variations:

CF7_get_current_user Current username
CF7_get_current_user key='ID' Current user’s ID
CF7_get_current_user key='user_nicename' Current user’s “Nice name”
CF7_get_current_user key='user_email' Current user’s email address

Referrer URL

CF7_referrer

Access the referrer URL, if it exists. Note that this is not necessarily reliable as not all browsers send this data.

Example

Dynamic Text tag:

[dynamictext inputname "CF7_referrer"]

On this page