Local Variables

Memberium has a concept of a local variable; being able to store data about the user in the local WordPress database, instead of Infusionsoft. This provides essentially unlimited fields (limited only by memory and disk space) for storing additional information. Local variables can be used in Memberium shortcode attributes.

You can capture data into local variables, you can display those variables to the screen, and you can use those variables in the parameters of shortcodes.

Local variables can be embedded into attributes by wrapping the variable in {{}}. Some variables have different syntaxes, and we may extend those syntaxes over time. Here’s some examples:

Example Usage

In this example, we’re showing how to insert a local variable (email) into a shortcode variable. You’ll see if you copy the example onto your page that {{contact.email}} is contained within the “redirect_url” parameter of the [memb_action_set] shortcode.

[memb_actionset_button button_text="Yes, Get Me Access" tag_ids="123" redirect_url="/promo/date-select.php?Email={{contact.email}}" css_class="my_button"]

We did this because a user wanted to put the email into the redirect link but you can’t put shortcodes inside of shortcodes. That’s part of why these local variables exist.

List of Codes

Contact Data

{{contact.firstname}}
{{contact.lastname}}
etc.

Author Contact ID (Added in 2.45)

{{author_contact_id}}

Post ID (Added in 2.49.01)

{{post_id}}

Affiliate Record Data

{{affiliate.id}}
{{affiliate.code}}

Custom Fields

{{field.fieldname}}

The visitor’s IP Address

{{ip_address}}

The Current Date

{{date.format}}
{{date.Y-m-d}}
{{date.N}}

Where “format” is the PHP date formatting code

Random Number Generator

{{random.MINVALUE,MAXVALUE}}

GET/POST/Cookie Values

{{post.key1}}
{{post.key1,key2,...}}
{{get.key1}}
{{get.key1,key2,...}}
{{session.key1}}
{{session.key1,key2,...}}

Miscellaneous

{{forloop}}
{{index}}
<<:: outputs [
::>> outputs ]
  • Was this Helpful?
  • YesNo
9 ways to add more value to your membership site

Table of Contents

Keep Reading

Nestable Shortcodes

When working with conditional shortcodes it’s often useful to have a series of tests, one after another, where each test determines if the user is qualified to continue to the next test.

Due to a limitation in WordPress’s design, the built-in shortcode system is very fast but it does not know how to count levels of nesting, so it cannot match each opening tag with its correct closing tag. In order to cleanly support this feature while not sacrificing performance, we provide the ability to nest shortcodes by giving each nested group of shortcodes a unique name by adding a number to the end. You can think of this like a Russian Matryoshka doll.

Read More »

Remote Files Support

Memberium includes enhanced support for Amazon’s Simple Storage Service (S3). Amazon S3 provides you with secure, durable, easy to use, highly-scalable object storage. With Amazon S3, you pay only for the storage you actually use. There is no minimum fee and no setup cost. This enables you to store large amounts of data at a very low cost. You pay for what you need, with no minimum commitments or up-front fees. With Amazon S3, you can store as much data as you want and access it when you need it. You can stop guessing your future storage needs and scale up and down as required, dramatically increasing business agility.

Read More »

Want to get some fresh ideas on how you can improve your membership site or course?

Download our free ebook!

Book a Call

Welcome to Memberium!

We are very excited for you to be part of our family. 

We would love to answer any questions that you have!

Please choose the best time for you to get in a call with us. 

For Technical Support, you can contact us at https://keap.memberium.com/support/ or Email us at support@memberium.com.