Adding Custom Reputation

4.36K viewsGeneral

I’m stumped, I know I can add a custom reputation option via Anspress > Reputation.

But how do I use this in a function?


I’ve already got a button hooked up to ajax, so a function is called on click. I just need to have it trigger the action/hook/filter to register the extra reputation but despite trawling through the code, docs, support I┬ácan’t find anything to work out what’s required to connect the custom rep event and the code I have.

Any suggestions or examples would be very, very helpful.


Hello Alex,

Check this file:

commented on answer

Ah, nice, thanks. Can you tell me, does this include handing duplicates? So if I were to add rep for a user for post x, then tried to add it again, would it let me?

(Also does the post have to be a real post ID, or could it signify something else i.e. a unique id in a separate database table column ).

You have to check duplicates before adding new reputation. Our reputation function does not check for duplicates.