Sorry, I should also have shown the other edit:
>>>>> $onclick = ”;
$link = sprintf( “%s“,
esc_url( add_query_arg( ‘replytocom’, $comment->comment_ID, get_permalink( $post->ID ) ) ) . “#” . $args[‘respond_id’],
$onclick,
esc_attr( sprintf( $args[‘reply_to_text’], $comment->comment_author ) ),
$args[‘reply_text’]
);
It seems that the only difference is that the URL doesn’t show the “replytocom=” id parameters when the full onclick event is allowed. When I set onclick to ”, “replytocom=” etc. parameter shows in the URL.
Example: This is what shows when onclick is ”:
http://mysite.com/nespresso/?replytocom=384#respond
This is what shows when the full onclick “return addComment.moveForm” etc. is used:
http://mysite.com/nespresso
Is this a problem?
Thanks
Fred
Please use <pre> tags when posting large blocks of code or paste your code in a Pastebin or Gist and link to it in your post.
When you reply to a comment this script moves the comment form below the actual comment you’re replying to for convenience. If you remove the script, it needs to re-load the page to do this.
If you don’t want this behaviour, do not 'comment-reply' in your theme.
Jacob… I’m struggling to obtain the comment_id of the parent of the reply. I’d like to place it’s value in an innerHTML of a div that I’ve included on the page, when the ‘Reply’ link is clicked.
If addcomment.moveform is removed via onclick=”, the page refresh includes the comment_id as a param in the URL, as in: http://mysite.com/nespresso/?replytocom=358#respond.
I can then use javascript to pull out the comment_id and use it.
But if I leave onclick as it is, and use moveform, there is, of course, no page refresh, hence no opportunity to get the comment_id.
I’m desperate to get that parent id. As mentioned, I’d like it stuffed into a div on the page.
Do you have any way I can get it?
Thanks,
Fred
I got it figured out… thanks