Title: API
Last modified: August 21, 2016

---

# API

 *  Resolved [Chris](https://wordpress.org/support/users/chriscodedesigns/)
 * (@chriscodedesigns)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/api-14/)
 * Is there a way to add karma points when processing a custom form??
 * Say I have a calculator and if a user uses it they gain karma points, how would
   I do this if the calculator is custom and part of the theme?
 * [http://wordpress.org/extend/plugins/achievements/](http://wordpress.org/extend/plugins/achievements/)

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

 *  Plugin Author [Paul Wong-Gibbs](https://wordpress.org/support/users/djpaul/)
 * (@djpaul)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/api-14/#post-3829590)
 * I can show you were to look if you are a PHP developer and know how WordPress
   plugins are built. Unfortunately, I haven’t created any guides yet.
 *  Thread Starter [Chris](https://wordpress.org/support/users/chriscodedesigns/)
 * (@chriscodedesigns)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/api-14/#post-3829667)
 * That would be good if you could show me where to look.
 *  Plugin Author [Paul Wong-Gibbs](https://wordpress.org/support/users/djpaul/)
 * (@djpaul)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/api-14/#post-3829717)
 * Take a look at [http://svn.wp-plugins.org/achievements/tags/3.3/includes/extensions/inviteanyone.php](http://svn.wp-plugins.org/achievements/tags/3.3/includes/extensions/inviteanyone.php)
 * Achievements works on WordPress’ actions. So, in your custom form, find or add
   a call to do_action in the appropriate place, and get the name of that action.
   You’ll need to set this in $this->functions in the constructor.
 * Essentially, what you need to do is duplicate that class, and set parameters 
   to suit.
    You’ll instantiate your class through a function hooked to dpa_init.
   e.g.
 * function chris_achievements() {
    require( ‘your_file.php’ ); } add_action( ‘dpa_init’,‘
   chris_achievements’ );
 * Have a go, it’s pretty straightforward. If you get stuck, pastebin it, and let
   me know what the precise difficulty is. Good luck!

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

The topic ‘API’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/achievements.svg)
 * [Achievements for WordPress](https://wordpress.org/plugins/achievements/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/achievements/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/achievements/)
 * [Active Topics](https://wordpress.org/support/plugin/achievements/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/achievements/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/achievements/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Paul Wong-Gibbs](https://wordpress.org/support/users/djpaul/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/api-14/#post-3829717)
 * Status: resolved