Docly Child

Setup Hooks

Estimated reading: 3 minutes 859 views

Setup Hooks

As of version 1.7, myCred Hooks are managed just like WordPress widgets. You have one “sidebar” called “Active Hooks” where you drag hooks you want to use. Hooks dragged out of the sidebar are disabled.

 

In older versions, Hooks are listed one by one and a green icon indicates the hook being enabled while red icon indicates the hook being disabled.

Figure 1. Hook management in older versions (pre 1.7).

Figure 2. Hook management as of version 1.7

Awarding Points

You can select to give your users points or take points for each instance a hook provides. In order to give points to a user, you need to set a positive amount e.g. 1 or 0.010. In order to take points from a user make sure you use a negative value e.g. -10 or -1.23.

 

If a particular hook has more than one instance, and you do not want to use one or more of these instances, make sure the amount is set to zero. Hooks will interpret zero as “feature turned off”.

Log Templates

Each time a hook awards or deducts points from your users, a log entry of this event is saved to your log. What is saved to the log is determined by the log template. This log template is the textual representation of the hook and is what your users will see when they view their history. So each template should be relevant to each hook to prevent confusions as to where the points actually came from / was taken for.

 

Log Templates are mandatory! Without a log template, the hook might not run correctly and the hook limit you might be using will not work!

Hook Limits

For instances where an event can occur more than once, such as comments or publishing content, all hooks provide you with a option to enforce a hook limit. You can enforce a daily, weekly, monthly or a total limit.

 

The value you set for your limit is the number of times the hook is allowed to run and not the amount of points a user can get. So a hook set to 10 / week means the hook can run a maximum of 10 times per week for each user.

Individual Hooks

You can find more information about each available hook along with setup guides in the Hooks category here in the codex or by clicking on the button below.

Leave a Comment

Share this Doc
CONTENTS