1. Documentation
  2. Shortcodes
  3. [gamipress_user_points]

[gamipress_user_points]

Output an user points balance.

Preview:

Attributes:

  • type – Single, or comma-separated list of, points type(s) to display. Accepts: all or any slug of any points type. Default: all
  • thumbnail – Display the points type featured image. Accepts: yes, no Default: yes
  • label – Display the points type label (singular or plural name, based on the amount of points). Accepts: yes, no Default: yes
  • current_user – Show points balance of current logged in user. Accepts: yes, no Default: yes
  • user_id – Show only points earned by a specific user.
  • inline – Display the points inline (as text). Accepts: yes, no Default: no
  • period – Filter points balance based on a specific period selected. By default “None” that will display user current points balance. Accepts: today, yesterday, this-week, past-week, this-month, past-month, this-year, past-year and custom
  • period_start – Period start date. Leave blank to no filter by a start date (points balance will be filtered only to the end date). Accepts: Accepts any valid PHP date format. (More information).
  • period_end – Period end date. Leave blank to no filter by an end date (points balance will be filtered from the start date to today). Accepts: Accepts any valid PHP date format. (More information).
  • columns – Columns to divide each points balance. Accepts: 1, 2, 3, 4, 5, 6 Default: 1
  • layout – Layout to show the points. Accepts: left, top, right, bottom or none Default: left
  • align – Alignment to show the points. Accepts: none, left, center, right or justify Default: none
  • wpms – Show user points from all network sites.

Example:
[gamipress_user_points type="all" columns="3" thumbnail="yes" label="yes" layout="left" align="none"]

Points on a period

[gamipress_user_points] includes the ability to show the user’s points balance on a set of predefined periods. There are a few examples:

Points earned this week of all types:
[gamipress_user_points type="all" period="this-week"]
Credits earned past year:
[gamipress_user_points type="credits" period="past-year"]

In addition, you have the ability to define custom time periods if you set the period attribute to custom. There are a few examples:

Points earned last 10 day of all types:
[gamipress_user_points type="all" period="custom" period_start="10 days ago" period_end="today"]
Credits earned on year 2018:
[gamipress_user_points type="credits" period="custom" period_start="2018-01-01" period_end="2018-12-31"]

Check the date fields page for more information about formats supported on period_start and period_end attributes.

How can we help?