0

I've created a hook for mycred following this tutorial.

I added the code to the function.php, and I am now wondering how to call it from my plugin?

I have no clue, and the tutorials that I've found also offer no advice.

Any advice?

My cred is a plugin that once installs, awards the users with points for their interaction with the site. More info can be found. here.

4
  • 1
    Welcome to WordPress Development. What's a mycred hook? Please add all relevant information into your question, to make it easier for others to help you. If the link goes down, then it's not possible to know what you're asking for. Thanks. – birgire Feb 15 '15 at 17:09
  • Can you provide the code used in the plugin? Assuming you have activated the plugin and include any files with relevant code in them, the implementation should be the same. – Rachel Baker Feb 15 '15 at 20:43
  • @birgire my bad, I thought that mycred was one of those things everyone knew about. Shows how little I know about wordpress! will update. – user1634781 Feb 16 '15 at 2:29
  • @RachelBaker hello, it's a demo hook they have in the site. I was just confused about how I was going to include it in my plugin. Eventually, I stopped over thinking and added this code where I loaded my page. $mycredhook = new my_demo_hook_class(); do_action( 'play_game', $mycredhook); Not sure, if it's the right way, but it worked. – user1634781 Feb 16 '15 at 2:37
1

Eventually I did this in the function of my plugin where I was loading my game,

$mycredhook = new my_demo_hook_class(); do_action( 'play_game', $mycredhook);

Not sure if this is the correct way to go, but it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.