qTranslate Separate Comments
[resolved] a little correction on code (2 posts)

  1. hyOzd
    Posted 3 years ago #


    I made a correction on the code. In function named fix_comments_count(), there is a typo. Line 123 is;

    $comments = $comments_query->query( array('post_id' => $post->ID, 'status' => 'approve', 'order' => 'ASC', 'meta_query' => array(array('key' => '_comment_language', 'value' => $q_config['language']))) );

    "$post->ID" is incorrect, I changed it to "$post_id" and line looks like this

    $comments = $comments_query->query( array('post_id' => $post_id, 'status' => 'approve', 'order' => 'ASC', 'meta_query' => array(array('key' => '_comment_language', 'value' => $q_config['language']))) );

    Now wordpress shows correct number of comments. But unfortunatelly this plugin is not working as it supposed to. It doesn't solve redirect problem of qtranslate and doesn't set correct language for comments.


  2. Nikola Nikolov
    Plugin Author

    Posted 3 years ago #

    Thanks for your fix, I'll add it as soon as I can :)

    The thing about the qTranslate redirection and setting of the language is that I add hidden inputs to the Comments form - I use an action for that and if you have a custom comments form template(instead of using the comment_form() WordPress function) that doesn't feature this action, then it won't work properly.

    Once I add your suggested fix, I'll also add this information to the FAQ section, so that people are aware of this :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • qTranslate Separate Comments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic