1. Documentation /
  2. Groups WooCommerce /
  3. API /
  4. Functions

Functions

Groups_WS_Membership_Shortcodes::groups_woocommerce_memberships( $atts, $content = null )

↑ Back to top
Renders time-limited group membership info for the current user. This is the handler method for the groups_woocommerce_memberships shortcode. The groups_woocommerce_show_membership filter can be used to modify how membership info is rendered. Arguments: The $atts parameter is an array and allows the following options to be passed:
  • "exclude" – Groups to exclude, a string enumerating group names separated by comma. By default, the “Registered” group is excluded.
  • "show_count" – Whether to show the number of memberships, enabled by default. Use "no" or false to disable.
  • "count_0" – The text to show when there are zero memberships.
  • "count_1" – The text to show when the user has one membership.
  • "count_n" – The text that is displayed when the user has more than one membership.
The $content parameter is not used. Return: string Rendered HTML membership info.

Groups_WS_Subscriptions_Shortcodes::groups_woocommerce_subscriptions_table( $atts, $content = null )

↑ Back to top
Renders a table showing a user’s subscriptions. This is the handler method for the groups_woocommerce_subscriptions_table shortcode. Arguments: The $atts parameter is expected to be passed as an array and recognizes the following options:
  • "status" string – The subscription status for subscriptions to include, defaults to "active". Can be a comma-separated list or * for all subscriptions.
  • "user_id" int – The user ID for which to list subscriptions. Defaults to the ID of the current user.
  • "show_count" boolean|string – Whether to show the number of subscriptions, enabled by default, false or "no" to disable.
  • "count_0" string – Text to display when there are no subscriptions to show, defaults to “No subscriptions.”
  • "count_1" string – Text to display when there is one subscription to show, defaults to “One subscription.”
  • "count_n" string – Text to display for more than one subscription to show, defaults to “%d subscriptions.” where %d is the placeholder used to display the number of subscriptions
  • "show_table" boolean|string – Whether to show the table of subscriptions. Enabled by default, false or "no" to disable.
  • "columns" string – A comma-separated enumeration of table columns to include in the output. Recognized columns are “status”, “title”, “start_date”, “expiry_date”, “end_date”, “trial_expiry_date”, “groups” and “order_id”.
  • "exclude_cancelled_after_end_of_prepaid_term" boolean|string – disabled by default, use true or “yes” to enable
  • "include_cancelled_orders" boolean|string – disabled by default, use true or "yes" to enable
  • "include_refunded_orders" boolean|string – disabled by default, use true or "yes" to enable
The $content parameter is not used. Return: string Rendered HTML subscription-based membership info.