Advertisement
simonwheatley

WPML Comment Merging change - 2

Sep 14th, 2011
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.63 KB | None | 0 0
  1. Index: wpml-comment-merging/wpml-comment-merging.php
  2. ===================================================================
  3. --- wpml-comment-merging/wpml-comment-merging.php   (revision 5466)
  4. +++ wpml-comment-merging/wpml-comment-merging.php   (working copy)
  5. @@ -41,7 +41,8 @@
  6.  function merge_comment_count($count, $post_ID) {
  7.     // get all the languages for which this post exists
  8.     $languages = icl_get_languages('skip_missing=1');
  9. -   $type = is_page($post_ID) ? 'page' : 'post';
  10. +   $post = get_post( $post_ID );
  11. +   $type = $post->post_type;
  12.  
  13.     foreach($languages as $l) {
  14.         // in $count is already the count from the current language
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement