Usage:

This shortcode is used to display portions of a page or post before a given date.

By using the ELSE option, alternate content can optionally be displayed when the user doesn’t satisfy the date requirement.

The date can be specified in any format understood by PHP’s “strtotime()” functions as well as by using contact custom fields holding valid dates.

Additionally, a special parameter, ‘#USER_REGISTERED#’, can be specified to use to the user’s WordPress registration date as the basis.

Any valid date used in the shortcode can also be modified by using an “adjust” parameter to define an “offset” from the basis date, such as “+3 months” or ‘-5 weeks’.

[ELSE_show_before] conditional branching is supported.
Shortcode nesting is NOT supported.

Parameters:

date Specifies the date before which the content segment should be displayed.

If a date is entered, that date will be used as the basis. We recommend using the “YYYY-MM-DD” format to preclude possible errors due to PHP localization which may, at times, misinterpret date formats, such 12/11/2016 (US) and 11/12/2016 (UK) and 11-12-2016 (Europe).

To use a contact’s ActiveCampaign data as the date, you can enter the name of the custom field between percent signs, such as %DATEJOINED% or %BIRTHDATE%. Custom field names can be different from what you intended them to be; please ensure that your are using the correct spelling, as stored in ActiveCampaign.

Finally, the special date parameter #USER_REGISTERED# can be used, in which case, the shortcode will use the user’s WordPress registration date.

Default: none.
Required: yes. If not given or not valid, the shortcode will default to the ELSE content, if included.

adjust A date adjustment string can be used to offset the date. This string must follow the rules used by PHP’s strtotime().

Examples:
“+1 day” : Adds one day to the date given in “date”.
“-1 week”: Subtracts one week from the date.
“+1 week 2 days 4 hours 2 seconds”: Add nine days, 4 hours and 2 seconds to the given date.

Default: none.
Required: no.

Example:

Simple date:

[mbr_show_before date='2016-09-30']
  Show this before September 30th, 2016
[ELSE_show_before]
  Sorry, you've missed the September 30th, 2016 deadline.
[/mbr_show_before]

Simple adjusted date:

[mbr_show_before date='2016-09-30' adjust='+10 days']
  Show this before October 10th, 2016
[ELSE_show_before]
  Sorry, you've missed the October 10th, 2016 deadline.
[/mbr_show_before]

Contact based date:

[mbr_show_before date='%DATEJOINED%']
  content-content-content
[ELSE_show_before]
  alternate-content-alternate-content
[/mbr_show_before]

Adjusted contact based date:

[mbr_show_before date='%DATEJOINED%' adjust='+10 days']
  content-content-content
[ELSE_show_before]
  alternate-content-alternate-content
[/mbr_show_before]

Based on an adjusted user’s WordPress registration date

[mbr_show_before date='#USER_REGISTERED#' adjust='+30 days']
    content-content-content
[ELSE_show_before]
    alternate-content-alternate-content
[/mbr_show_before]

API:

There is currently no ActiveMember360 API function equivalent for this shortcode.