Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: wpml-comment-merging/wpml-comment-merging.php
- ===================================================================
- --- wpml-comment-merging/wpml-comment-merging.php (revision 438094)
- +++ wpml-comment-merging/wpml-comment-merging.php (working copy)
- @@ -14,10 +14,13 @@
- }
- function merge_comments($comments, $post_ID) {
- + global $sitepress;
- + remove_filter( 'comments_clauses', array( $sitepress, 'comments_clauses' ) );
- // get all the languages for which this post exists
- $languages = icl_get_languages('skip_missing=1');
- - $type = is_page($post_ID) ? 'page' : 'post';
- - foreach($languages as $l) {
- + $post = get_post( $post_ID );
- + $type = $post->post_type;
- + foreach($languages as $code => $l) {
- // in $comments are already the comments from the current language
- if(!$l['active']) {
- $otherID = icl_object_id($post_ID, $type, false, $l['language_code']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement