WP-ajax-like-button icon indicating copy to clipboard operation
WP-ajax-like-button copied to clipboard

Enqueue script instead of echoing in script tag

Open mmaumio opened this issue 10 years ago • 1 comments

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

mmaumio avatar Jan 26 '15 22:01 mmaumio

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!

daveyheuser avatar Feb 05 '15 18:02 daveyheuser