Renders enclosed content only if a visitor was referred.

Pages using this shortcode should not be cached.


This example shows how you can achieve an invite-only affiliate program.

You have been referred by [referrer display="name"] and are eligible to sign up for our privileged partner program.

This would show the referrer’s name to the visitor if the visitor was referred by an affiliate and allow the visitor to sign up as an affiliate, too.

The conditional shortcode wrapping the message is useful here. Without it, anyone could sign up and the message would show even if the visitor was not referred, resulting in an unfinished sentence (as the name would be blank) and a registration form accessible to anyone.