• Hi there,

    I’ve integrated the comments_like_dislike() function directly inside a custom comment layout (without using comment_form()), and I noticed that the frontend scripts from your plugin are only enqueued via the comment_form action:

    comments_like_dislike($comment->comment_ID);
    do_action('comment_form'); // workaround to load frontend scripts

    While this workaround works, it’s a bit of a hack and could easily be forgotten or misused in custom templates. I believe it would be cleaner and more reliable to conditionally enqueue the frontend assets directly when comments_like_dislike() is called, instead of relying on the comment_form hook.

    That way, developers using custom comment displays wouldn’t need to manually trigger do_action(‘comment_form’) just to load the plugin assets.

    Let me know if you’d consider improving this!

    Thanks for the great plugin.

The topic ‘Improve Asset Loading for Custom Templates’ is closed to new replies.