
If you use the mycred_link shortcode, this announcement is for you.
The onclick attribute is being phased out. It will be replaced with a WordPress-native JavaScript hook system. This new approach uses wp.hooks to handle click actions safely.
What’s Changing
- onclick attribute is no longer supported in Shortcode.
- Developers can attach their custom logic using mycred_link_click JavaScript action:
wp.hooks.addAction(‘mycred_link_click’, ‘mycred/custom-handler’, function(el, e) {
// Custom behavior here
});
Migration Plan
Phase 1 – Already Released
- The new hook system has been introduced.
- onclick is still working temporarily to avoid breaking existing sites.
- Documentation and guidance provided.
Phase 2 – Following Release (~1 month later)
- Inline onclick will be removed entirely.
- The hook system becomes the only supported method.
What You Need to Do
- Update your site to use the hook system instead of onclick.
- Move any existing click logic into wp.hooks.addAction.
- Test all interactions to ensure behavior remains the same.
Developer’s Guide
Get a complete understanding of this announcement here: https://codex.mycred.me/shortcodes/mycred_link/
No other shortcode usage, content structure, or myCred point logic changes. The update is purely a shift from inline JavaScript to a safer, hook-based approach.
Final Word
The transition is planned and gradual. Phase one gives you time to adapt. Phase two completes the move. Take action early. Move your logic to the hook system now to ensure your site remains fully compatible with future releases.
