Achievements for WordPress
[resolved] API (4 posts)

  1. Chris
    Posted 2 years ago #

    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?


  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 2 years ago #

    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.

  3. Chris
    Posted 2 years ago #

    That would be good if you could show me where to look.

  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 2 years ago #

    Take a look at 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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Achievements for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.