mbr_show_before
Usage
This shortcode determines the content to be included based upon whether the current date is before the specified date adjusted as requested.
The specified date can be:
The current date.
Any date formatted according to the the syntax rules set for PHP as detailed within date formats.
Any ActiveCampaign contact date field. Most ActiveCampaign date fields are properly formatted and will function correctly.
The date field is specified by using the ActiveCampaign personalization tag for the contact field (Perstag) with the characters % before and after the tag for the
date
parameter. The available Perstags can be found in ActiveMember360, Utilities, Contact Fields.Alternatively see [mbr_contact] for information upon how to reference ActiveCamapign contact fields.
The logged in users registration date for WordPress specified by using
#USER_REGISTERED#
for thedate
parameter.
Parameters
Parameters | Description |
---|---|
date | The specified date must provide a value that follows the syntax rules set for PHP as detailed within date formats. Most ActiveCampaign date fields are properly formatted and will work. Default: none. Required: yes. |
adjust | Any text operator that follows the syntax rules as detailed for PHP strtotime(). This will modify the specified date. Default: none. Required: no. |
Validity
This shortcode is evaluated for any type of visitor.
Conditional Branching
[ELSE_show_before] conditional branching is supported.
Nesting
Shortcode nesting within is NOT supported.
Examples
- Example 1
- Example 2
- Example 3
- Example 4
- Example 5
- Example 6
Displays 'Here is the special offer' if the current date is before 2021-Dec-05:
[mbr_show_before date='20211205']
Here is the special offer
[/mbr_show_before]
Displays 'Here is the special offer' if the current date is before 2021-Dec-05 otherwise it returns 'Sorry the special offer is no longer available':
[mbr_show_before date='20211205']
Here is the special offer
[ELSE_show_before]
Sorry the special offer is no longer available
[/mbr_show_before]
Displays 'Here is the special offer' if the current date is before 2022-Mar-03 i.e. 2021-Dec-03 with 3 months added:
[mbr_show_before date='20211203' adjust='+3 months']
Here is the special offer
[/mbr_show_before]
Displays 'Here is the special new member content' if the current date is before the date of the logged in users WordPress registration with +30 days added. Otherwise 'Enjoy the content available for members here' is shown:
[mbr_show_before date='#USER_REGISTERED#' adjust='+30 days']
Here is the special new member content
[ELSE_show_before]
Enjoy the content available for members here
[/mbr_show_before]
Displays 'Here is the special new member content' if the current date is before the date stored within the ActiveCampaign contact field with perstag joiningdate
for the remote user with 10 days added. Otherwise 'Enjoy the content available for members here' is shown:
[mbr_show_before date='%JOININGDATE%' adjust='+10 days']
Here is the special new member content
[ELSE_show_before]
Enjoy the content available for members here
[/mbr_show_before]
Displays 'Here is the special offer' if the current date is before the date stored within the ActiveCampaign contact field my_custom_field
for the remote user with 1 week added:
[mbr_show_before date='[mbr_db_my_custom_field]' adjust='+1 week']
Here is the special offer
[/mbr_show_before]
API
There is currently no ActiveMember360 API function equivalent for this shortcode.