WPFusion
Overview
WP Fusion includes a few shortcodes that let you display user meta, and show / hide content based on a user’s tags in your CRM. These can be used to personalize the site content based on a user’s custom fields or tags.
#Displaying user meta
You can use shortcodes to display meta data for logged in users. The syntax is pretty simple. For example, to show a user’s first name:
Any field listed in the Contact Field tab of WP Fusion’s settings can be accessed in this way.
You can also display different information for users who haven’t registered yet, or aren’t logged in, like so:
Welcome, Guest!
Logged in users will see their first name, while visitors will see “Welcome, Guest!”
#User meta formatting
WP Fusion supports formatting date and time fields using PHP’s date function. For example:
This will output the date like 2019-03-10.
For escaping text in the date format, use a double backslash. For example:
This will output the date like Friday the 22nd of March, 2019. For more information on the syntax see PHP’s date documentation.
#User meta formatting – timezone offset
WP Fusion syncs dates with most CRMs in UTC. To correct for this, the user_meta
shortcode will adjust the date to local time (based on the site’s timezone) before displaying it.
Sometimes this can result in the time being displayed incorrectly, especially if you are entering dates via another plugin and they are already in local time. To manually correct the timezeone conversion, you can use the timezone-offset
parameter, for example
This will display the date and time, corrected backwards two hours. The timezone-offset
parameter accepts any positive or negative number.
#Video – Displaying user meta
#Displaying a contact ID
You can display the current user’s contact ID as well. The format is . For example with Infusionsoft the shortcode would be:
#Displaying content based on tags
You can use these shortcodes to show and hide content based on a user’s logged in status and CRM tags.
#Restricting content based on logged in status
You can use the following two shortcodes to show content based on whether or not a user is logged in, regardless of their tags. This works like:
Only visible to logged out visitors
#Restricting content based on tags
To restrict content based on a user’s CRM tags, wrap the desired content in the WP Fusion shortcode, using the examples below.
This content will only show if the user is logged in and has the tag “New Customer”:
[Restricted Content
This content will only show if the user is logged in and has both the tags “New Customer” and “Purchased Course”:
#Show the content if a user does not have a tag
To show content only if a user doesn’t have a certain tag, use the following syntax:
Restricted Content
You can also combine multiple tags for the not
parameter, like
Restricted Content
In that case the content will be hidden if the user has any of the tags. So if the user is tagged either New Customer or Active Member, the content will be hidden.
You can also combine parameters for more advanced locking, like so:
#Requiring any tag, instead of all
By default, WP Fusion will only unlock the content if the user has all of the tags in the list. To make it so that the content will unlock when any of the tags are found, include method="any"
in the shortcode, like:
#Else conditions
The shortcode also supports an “else” condition. The usage works like:
Shows only to users with the "New Customer" tag
#Logged out parameters
By default, content in the shortcode will always be hidden from users who aren’t logged in. You can change this by adding logged_out
to the shortcode. For example:
This will show to everyone who doesn't have the "New Customer" tag, including logged out visitors.
or:
Shows to all users who don't have the "New Customer" tag, as well as logged-out visitors.
#Square brackets in tag names
WordPress does not allow square brackets in shortcode parameters. If your tag names have square brackets in them, you can use parentheses instead and they will be treated as equivalent by WP Fusion.
For example if your tag name is [Customer] Paid Course, your shortcode will work with .
#Displaying content based on page rules
Using the ]
shortcode, you can show and hide content based on the access rules configured in the WP Fusion meta box on another post.
For example, this shortcode shows a message only if the current user has permission to access a course with post ID 456.
[ Thanks for signing up for Awesome Course!
#Else conditions
This shortcode also accepts an [else]
condition:
Thanks for signing up for Awesome Course!
#Within a loop
If the id=
parameter is omitted, the shortcode will use the current post ID. This can be used in a loop or custom template to personalize the results.
For example to alternate the Elementor template displayed based on a user’s permissions:
// Enrolled template
#Displaying content based on user meta values
As of January 2021, WP Fusion includes a new Or to check someone’s BuddyPress account status: As another example, you can compare numeric values using the In that example the content will only be displayed if the user’s Note that you must have a field called You can get a little more fancy by making use of the For more info on valid inputs to This one is a bit complicated. Let’s break it down: The end result is that the message will be hidden until five days before the student’s next exam date, at which point it will be shown. WP Fusion can also evaluate against partial matches in a meta value. For this, use either This works with either strings, or data stored as an array. For example, let’s say you have a usermeta field called The result is the same if You can insert a shortcode into your pages to force an update of a users tags and/or meta data before the rest of the page is displayed. This can be used to force a rehttp://http://http://http://http://http://https://freshhouse.tv/wp-content/uploads/2022/04/Getting-started-1.svghouse.tv/wp-content/uploads/2021/11/Multipure-clean-circle-2-1.pnghouse.tv/wp-content/uploads/2021/11/gamipress-icon-diamond-1.pnghouse.tv/wp-content/uploads/2021/11/Enagic-Gold-Standard-2.pnghouse.tv/wp-content/uploads/2021/11/FreshHouse.TV-Bless-2.pnghouse.tv/wp-content/uploads/2021/08/Ascension-Library-108-1.jpghouse.tv/wp-content/uploads/2021/07/Fresh-House-Tree-Logo-1.jpg of data from your CRM before displaying content using the To force an update of the current user’s tags, use: To force an update of the current user’s meta data, use: AffiliateWP Shortcodes A complete reference to all available shortcodes you can use with AffiliateWP and our free and pro add-ons. Note: These do not include shortcodes in the page for 3rd-party add-ons.
#Numeric comparisons
compare=
attribute, for example with lifetime value:lifetime_value
field is greater than 100.lifetime_value
for the user in your database. WP Fusion does not track lifetime values.#Date comparisons
field_format=
and value_format=
attributes, along with the strtotime()
function.strtotime()
see the PHP manual.
next_exam_date
from the wp_usermeta table. It can be in any date string. For example 2021-01-25 8:15am
1611558900
strtotime()
which gives us a timestamp for five days agocompare=">="
The greater than or equal to comparison. The condition will only be met if the student’s next exam date is greater than or equal to 5 days ago.#IN and NOT IN
compare="IN"
to search for the value inside the user meta field, or compare="NOT IN"
to invert the logic.favorite_animals
. For the current user, it is set to "Dogs, Horses, Cats"
. The following would display the content:favorite_animals
is an array, like array( "Dogs", "Horses", "Cats" )
.#Updating data
[. wpf. ]
or [. user_meta. ]
shortcodes.[. wpf_update_tags. ]
[. wpf_update_meta. ]
Shortcode Reference
AffiliateWP Core Plugin
Free Add-ons
Affiliate Area Shortcodes
Shortcodes for the Affiliate Area
Shortcodes for Individual Stats
Affiliate Info
Affiliate Leaderboard
Order Details for Affiliates
Show Affiliate Coupons
Note: this shortcode is included with AffiliateWP as of v2.6+Store Credit
Pro Add-ons
Affiliate Landing Pages
Direct Link Tracking
Lifetime Commissions