Bitcoin and Altcoin Wallets: Paywall extension 1.0.1

Shortcodes

Table of Contents

shortcode_subscription_extend()  : string
The `[wallets_paywall_extend]` shortcode allows users to pay and subscribe or extend their subscriptions.
shortcode_subscription_expires()  : string
The `[wallets_paywall_expires]` shortcode displays the date/time on which the specified subscription will expire for the current user.
shortcode_subscription_remaining()  : string
The `[wallets_paywall_remaining]` shortcode displays the time remaining for the user on the specified subscription.
shortcode_subscription_if()  : string
shortcode_subscription_if_not()  : string

Functions

shortcode_subscription_extend()

The `[wallets_paywall_extend]` shortcode allows users to pay and subscribe or extend their subscriptions.

shortcode_subscription_extend(array<string|int, mixed> $atts, string $content, string $tag) : string

The shortcode displays a UI that lists the possible subscriptions and currencies.

When a subscription is selected, the user is informed as to the status of their subscription, and the price of extending this subscription using the selected currency.

When a currency is selected, the user is displayed their available balance on this currency, as well as the price of extending the selected subscription using this currency.

If the available balance is not sufficient to pay for extending the selected subscription, then it is shown in red and the payment button is disabled.

Parameters
$atts : array<string|int, mixed>
  • [sub_id] If specified, this is the post_id of the subscription that should be selected by default.
  • [text_pay] Text displayed on button for subscriptions that do expire. Default: Pay %1$s and extend %2$s by %3$d %4$s
  • [text_pay_once] Text displayed on button for subscriptions that do not expire. Default: Pay %1$s and subscribe as %2$s
  • [template] Specialized template part. If you set template="foo", it will load the templates/extend-foo.php file.
$content : string

No content as this shortcode is not nested.

$tag : string

Equal to wallets_paywall_extend

Return values
string

HTML

shortcode_subscription_expires()

The `[wallets_paywall_expires]` shortcode displays the date/time on which the specified subscription will expire for the current user.

shortcode_subscription_expires(array<string|int, mixed> $atts, string $content, string $tag) : string

The value updates dynamically by polling the WP-REST API.

Alternative templates: template="timestamp" displays the expiry time in UNIX timestamp format, but only if there is one.

Parameters
$atts : array<string|int, mixed>
  • [sub_id] If specified, this is the post_id of the subscription that should be selected by default.
  • [template] Specialized template part. If you set template="timestamp", it will load the templates/expires-timestamp.php file.
$content : string

No content as this shortcode is not nested.

$tag : string

Equal to wallets_paywall_expires

Return values
string

HTML

shortcode_subscription_remaining()

The `[wallets_paywall_remaining]` shortcode displays the time remaining for the user on the specified subscription.

shortcode_subscription_remaining(array<string|int, mixed> $atts, string $content, string $tag) : string
Parameters
$atts : array<string|int, mixed>
  • [sub_id] If specified, this is the post_id of the subscription that should be selected by default.
  • [template] Specialized template part. If you set template="foo", it will load the templates/remaining-foo.php file.
  • [details] If set to an integer, this many time units will be shown, starting from the largest. The remaining units will be omitted.
$content : string

No content as this shortcode is not nested.

$tag : string

Equal to wallets_paywall_remaining

Return values
string

HTML

shortcode_subscription_if()

shortcode_subscription_if(mixed $atts, string $content, string $tag) : string
Parameters
$atts : mixed
$content : string
$tag : string
Return values
string

shortcode_subscription_if_not()

shortcode_subscription_if_not(mixed $atts, string $content, string $tag) : string
Parameters
$atts : mixed
$content : string
$tag : string
Return values
string

Search results