Usage:
This shortcode enables you to display a list of subscriptions to your subscribers, based on the currently logged in user.
By using different parameter combinations, this shortcode can be used to display different views of the subscriptions on file in your system, such as with the “status” filter set to “all”, “active” or “inactive”.
You can stipulate to display the list in ascending or descending order, based on the date the subscriptions was purchased.
You can also specify which fields you want included in the table display. The “official” list of accepted field names can be found here.
You can set your own headers for each column in the generated table.
Every item in the generated table is CSS-enabled. If you would rather apply a different style, you can do so by passing those CSS definitions that you wish to override.
This shortcode does NOT supports conditional branching with [ELSE_list_subscriptions].
Shortcode nesting is NOT supported.
Parameters:
status | Is used to filter the list based on “valid” status. Can be ‘all, ‘active’ or ‘inactive’. Required: No, defaults to ‘all’. |
columns | Is used to specify the columns for the generated table. Required: No, defaults to ‘ProgramName,Status,BillingCycle,StartDate,PaidThruDate,NextBillDate,BillingAmt’. |
headers | Is used to specify columns headers for the generated table. Required: No, defaults to ‘Program Name,Status,Cycle,Start,Paid Thru,Next Bill Date,Amount’ – if the columns are set to default, otherwise, the field names are used. |
sort | Is used to specify the order of display, ‘asc’ for ascending and ‘desc’ for descending, based on the date the subscription(s) were added to the database. Required: No, defaults to ‘asc’. |
Example:
[i4w_list_subscriptions] Used this way, the shortcode will run with pre-established defaults (see parameters below).
[i4w_list_subscriptions status='all'] The shortcode will use defaults and will produce a list of "Active" and "Inactive" subscriptions (Note: this is the default behavior and need not be specified).
[i4w_list_subscriptions status='active'] The shortcode will use defaults but will only produce a list of "Active" subscriptions.
[i4w_list_subscriptions status='inactive'] The shortcode will use defaults but will only produce a list of "Inactive" subscriptions.
[i4w_list_subscriptions sort='asc'] The shortcode will use defaults and will produce a list of "Active" and "Inactive" subscriptions, sorted in ascending order (Note: this is the default behavior and need not be specified).
[i4w_list_subscriptions sort='desc'] The shortcode will use defaults and will produce a list of "Active" and "Inactive" subscriptions, sorted in descending order.
[i4w_list_subscriptions columns='ProgramName,Status'] By using the "columns" parameter, you can specify fields other than the defaults (see parameters below). In this (example) case, the list would only consist of two columns.
[i4w_list_subscriptions columns='ProgramName,Status' headers='Subscription,Status'] By specifying "headers", the shortcode will use those as column headers instead of the field (columns) names.
CSS definition:
If you want to pass your own CSS style definitions to the shortcode, you must do so as follows:
<strong>[i4w_list_subscriptions]</strong> #i4w_subtbl.i4w_table {background-color:#666666;line-height:17px;font-family: Arial;font-size:11px;text-align:left;min-width:600px;width:auto;overflow:hidden;} #i4w_subtbl.i4w_title {color:darkblue;text-align:center;font-size:15px;} #i4w_subtbl.i4w_tr_headers {padding:0} #i4w_subtbl.i4w_td_header {border:0;color:white;font-weight:bold} #i4w_subtbl.i4w_td_header.right {text-align:right;} #i4w_subtbl.i4w_tr_data {padding:3px} #i4w_subtbl.i4w_tr_data.i4w_even {background-color:#F3F3F3;} #i4w_subtbl.i4w_tr_data.i4w_odd {background-color:#FFFFFF;} #i4w_subtbl.i4w_td_data {color:black;border:0;} #i4w_subtbl.i4w_td_data.valid {color:darkgreen;} #i4w_subtbl.i4w_td_data.invalid {color:darkred;} #i4w_subtbl.i4w_td_data.right {text-align:right;} [/i4w_list_subscriptions]
The above CSS are the current defaults.
Please note that since the shortcode may be used multiple times on a single page/post to represent different views, the CSS elements’ ID’s will be automatically be randomized for each instance.