[wp-hackers] Move Comment JavaScript and Comment Metadata Display

Otto otto at ottodestruct.com
Tue Jan 12 17:37:29 UTC 2010


On Tue, Jan 12, 2010 at 11:22 AM, Chris Poteet <cpoteet at siolon.com> wrote:
> Not only does unenqueing the comment-reply.js throw a JS error it
> doesn't add all my "Reply" links.

No, the reply links are not generated by the javascript, they're
generated in the core code and/or by your theme. The
comment_reply_link function generates them, and that's called by the
wp_list_comments. If your theme is overriding the output of
wp_list_comments, like too many do, then it may not be calling that
function correctly.

The comment-reply javascript only changes the behavior of those links.
Without it, those links cause a page reload, with a replytocom=1234
tacked onto the URL. This makes it so you're replying to the comment
correctly without javascript help.

If you want to change the behavior of the comment-reply javascript so
as to avoid the reloading but not move stuff, then you'll need to:

a) Not enqueue comment-reply,
b) Make a copy of wp-includes/js/comment-reply.dev.js into your theme directory,
c) Modify your copy to do what you want it to do, behavior-wise, and
d) Enqueue that script instead.

-Otto


More information about the wp-hackers mailing list