Skip to content
johnregan3 edited this page Jul 21, 2013 · 2 revisions

< Gamify WP Setup

Gamify WP allows you to award points for an endless array of actions on your site. For instance, suppose you're using a eCommerce plugin, and you want to award points for making a purchase. With Gamify WP, you can hook into the plugin and reward your users for buying your items.

Custom Actions are based on Action Hooks (more about WordPress Action Hooks). The three most useful Action Hooks (user_register, comment_post, and publish_post) are already included in the plugin, and can be configured on the General Settings Page under "Default Actions." However, you may be using another WordPress Plugin that has its own Action Hooks.

To find the Action Hooks in a Plugin, run a Find in Files search and search for "do_action". Action Hooks can be identified by the following code:

do_action( 'action_hook' ...);

In this code, 'action_hook' is where you'll find the text you'll need to set up your own Custom Action. Note the PHP function "do_action' (not to be confused with the function 'add_action').

Create a New Custom Action

Custom Actions in Gamify WP are set up very similarly to regular posts. Navigate to "Custom Actions" in the WordPress sidebar, then click "New Custom Action".

Title

The Custom Action Title is a past-tense description of the Action (event) that the user triggers. This text will display to the user when they earn points, as in "Commented for 100 Points." In this case, the word "Commented" would be the Custom Action Title.

Action Hook

Here you enter a WordPress Action Hook (see above for more information).

Points

This is the number of points to be awarded for completing this Action.

Include in Daily Limit (Check field title)

See above (Settings Options > Daily Limit).

Save

Press "Publish," and your Custom Action will become active. Likewise, to deactivate/disable a Custom Action, simply Unpublish it.

< Gamify WP Setup

Clone this wiki locally