A free points management plugin for WordPress.
myCRED Logo
myCRED Logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download
    Navigation
    • Loading navigation ...
    All Actions
    myCRED actions
    1. mycred_add_menu
    2. mycred_admin_enqueue
    3. mycred_admin_init
    4. mycred_after_deletion
    5. mycred_after_notifications
    6. mycred_banking_compound_interest
    7. mycred_banking_recurring_payouts
    8. mycred_before_deletion
    9. mycred_before_notifications
    10. mycred_deactivation
    11. mycred_email_sent
    12. mycred_front_enqueue
    13. mycred_init
    14. mycred_pre_init
    15. mycred_set_user_balance
    16. mycred_tool_bar
    17. mycred_transfer_completed
    18. mycred_transfer_ready
    19. mycred_twilio_action_$action
    20. mycred_twilio_after_prefs
    21. mycred_twilio_incoming_sms
    22. mycred_twilio_transfer_cancelled
    23. mycred_twilio_transfer_finished
    24. mycred_update_user_balance
    25. mycred_user_got_demoted
    26. mycred_user_got_promoted
    27. mycred_widgets_init
    Categories
    Filter by category
    1. Actions
    2. Classes
    3. Filters
    4. Functions
    5. Hooks
    6. Objects
    7. Shortcodes
    8. Template Tags
    Chapters
    Documentation
    1. Chapter I - Introduction
    2. Chapter II - Getting Started
    3. Chapter III - Add-ons
    4. Chapter IV - Premium Add-ons
    5. Chapter V - For Developers
    6. Chapter VI - Reference Guides
mycred_update_user_balance

Codex / mycred/balance / Actions / mycred_update_user_balance

Description

This action allows you to execute custom actions when a users balance changes. Note that this action fires after a users balance has been updated and not before. Also no transaction details are available besides the users ID, the amount gained / lost and the point type.

Available since version 1.1

Parameters
Param Type Required Description
$user_id int No

The ID of the user.

$current_balance - No

The users “current balance” before it was adjusted.

$amount - No

The amount added or deducted from the users current balance. A positive value represents point gains while negative value represents point loss.

$type string No

The point type.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Send admin an email when a users balance reaches 10000.

About myCRED

myCRED is a free, open-source and developer friendly points management tool for WordPress powered websites.

Download Rate Plugin

Documentation

  • Add-ons
  • Core Shortcodes
  • F.A.Q.
  • Tutorials
  • Third Party Plugins
  • Code Snippets

Support

  • Product Licenses
  • Customization
  • Support Forums
  • Plugin Changelog
  • Contact

Copyright 2013 - 2022 byWPExperts; All rights reserved. myCRED is licensed under GPL 2.0

Terms & Conditions • Use of Cookies • Store Policy • Community Rules

Suggest Codex Example

You can submit suggestions for codex examples that you have available as a public gist. If you are a member on the mycred.me website, you can earn Tokens for each submission. To claim these Tokens, make sure you provide your mycred.me username.

Please make sure the example you submit is relevant and if you include documentation, it's provided in English.

logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download