WP-ajax-like-button
WP-ajax-like-button copied to clipboard
Enqueue script instead of echoing in script tag
Hi, I'd like to thank you for your hard work and distributing it for free. It helped me put the like and dislike button in my Theme.
I was wondering If you'd Enqueue the admin-ajax.php file in the post-like.php on wp_enqueue_scripts hook and passing the url through wp_localize_script instead of echoing the hard coded script tag on the wp_head hook.
That'd be the best practice of the script.
Regards -Muntasir
Hey that's actually a very good idea, I'm working on a website where I'll also implement this in and make an update when I get there.
Thanks for your kind words!