How do I hook a myCRED function to social sharing

Hi, I'm using a website with myCRED enabled, and I'm trying to figure out if there's a way to tie the myCRED add function into social sharing clicks, such that any time a user shares a page, there awarded 10 points.
Are there any action hooks or filters in Hustle that could be used in a custom plugin?

  • Oguz
    • QA Engineer

    Hey Samantha ,

    Hope you're doing well today.

    Unfortunately, there is no action for that at Hustle. But you can achieve that with JS codes. You can do that with catching social link clicks then execute myCRED functions with Ajax requests. JS code will be something like this;

    $(document).on('click', 'a.native-social-share', function() {
    	//ajax request
    });

    For the server side and complete Ajax example you can read this wonderful blog post: https://premium.wpmudev.org/blog/using-ajax-with-wordpress/

    If you have any additional questions please let me know and I’ll be happy to help.

    Cheers!
    Oguz

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.