Title: Milestones Notification
Last modified: August 21, 2016

---

# Milestones Notification

 *  Resolved [envieme](https://wordpress.org/support/users/envieme/)
 * (@envieme)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/milestones-notification/)
 * So I would like to implement something called milestones to egg users to participate
   more.
 * How it works is once user crosses set number of points, they see a popup with
   congrats message something like “Awesome, you crossed a milestone of 100 points”
   and some information like the rank widget (with their rank appended), and some
   other info / message.
 * Will something like this work?
 * add_action( ‘init’, ‘mycred_milestones’ );
    function mycred_milestones() { $i
   = bp_loggedin_user_id(); $bal = mycred_get_users_cred( $i ); if ($bal|500 == 
   0) // milestone for every 500 points // call to jquery function to trigger the
   popup }
 * Or better question,
 * What is the best way to add_action. Am new to wp & bp so not know the best way
   for triggering an action something like this.
 * Can you please guide.
 * [https://wordpress.org/plugins/mycred/](https://wordpress.org/plugins/mycred/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Mike](https://wordpress.org/support/users/iskon47/)
 * (@iskon47)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/milestones-notification/#post-5084840)
 * This sounds fantastic! Great idea!
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/milestones-notification/#post-5084843)
 * Hey.
 * That would work but you should also wrap your code in a conditional check to 
   make sure myCRED is installed. You could use:
 *     ```
       if ( function_exists( 'mycred_get_users_cred' ) ) {
   
       }
       ```
   
 * Otherwise when you disable myCRED (for example when you update it) your code 
   could cause a fatal PHP error turning your screen white since the function you
   want to use will not be available.
 *  Thread Starter [envieme](https://wordpress.org/support/users/envieme/)
 * (@envieme)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/milestones-notification/#post-5084875)
 * Oh thanks very much. Will do.
 * Btw I am having problems printing the same data the top mycred users widget shows
   onto to a popup. How do I query it the best way?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Milestones Notification’ is closed to new replies.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

## Tags

 * [add_action](https://wordpress.org/support/topic-tag/add_action/)
 * [popup](https://wordpress.org/support/topic-tag/popup/)

 * 3 replies
 * 3 participants
 * Last reply from: [envieme](https://wordpress.org/support/users/envieme/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/milestones-notification/#post-5084875)
 * Status: resolved