• When I comment out the below in comment-template.php, it seems to have no effect on anything.

    /*
    $onclick = sprintf( ‘return addComment.moveForm( “%1$s-%2$s”, “%2$s”, “%3$s”, “%4$s” )’,
    $args[‘add_below’], $comment->comment_ID, $args[‘respond_id’], $post->ID
    );
    */

    Can someone explain what the purpose of this is?

    Thanks,
    Fred

    • This topic was modified 8 years, 8 months ago by punchlines.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter punchlines

    (@punchlines)

    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.

    Thread Starter punchlines

    (@punchlines)

    Thanks, Jacob..

    Fred

    Thread Starter punchlines

    (@punchlines)

    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

    Thread Starter punchlines

    (@punchlines)

    I got it figured out… thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Purpose of addComment.moveForm’ is closed to new replies.