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_user_got_promoted

Codex / mycred/rank / Actions / mycred_user_got_promoted

Description

This action hook fires each time a user has been promoted to a rank that has a higher minimum point requirement set then their previous rank. For demotions, please see the mycred_user_got_demoted action.

In most cases, this action fires during the point payout / deduction process. For this reason, you can not use any function that adds or deducts points from a users account e.g. mycred_add or mycred()->add_creds(). If you do, you will create an infinite loop!

Available since version 1.4

Parameters
Param Type Required Description
$user_id int No

The ID of the user that is affected by this promotion.

$rank_id int No

The rank post ID that the user was promoted to.

$request obj No

The database requests that caused this action to fire. (Added in 1.7).

Available details:

  • rank_id – The new rank ID the user has reached
  • current_id – The ID of the users current rank that they will lose
  • minimum – The new ranks set minimum balance requirement
  • maximum – The new ranks set maximum balance requirement

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

Example 1: When a user reaches the rank with the ID 123, we give them a 10 point bonus.

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