Permalink
Browse files

lack of keys in the array are causing some likes, etc. not to display…

… properly
  • Loading branch information...
1 parent 527d173 commit ac5ae4ce13e4151f11da26ed449b254502a600a1 @alexkingorg alexkingorg committed Jan 5, 2012
Showing with 8 additions and 8 deletions.
  1. +4 −4 social-facebook.php
  2. +4 −4 social-twitter.php
View
@@ -122,16 +122,16 @@ public static function comments_array(array $comments, $post_id) {
// we need comments to be keyed by ID, check for Facebook comments
$facebook_comments = $facebook_likes = $_comments = $comment_ids = array();
foreach ($comments as $key => $comment) {
- if ($key == 'social_items') {
- $_comments[$key] = $comment;
- }
- else {
+ if (is_object($comment)) {
$_comments['id_'.$comment->comment_ID] = $comment;
if (in_array($comment->comment_type, array('social-facebook', 'social-facebook-like'))) {
$comment_ids[] = $comment->comment_ID;
$facebook_comments['id_'.$comment->comment_ID] = $comment;
}
}
+ else { // social items
+ $_comments[$key] = $comment;
+ }
}
// if no Facebook comments, get out now
View
@@ -55,16 +55,16 @@ public static function comments_array(array $comments, $post_id) {
// we need comments to be keyed by ID, check for Tweet comments
$tweet_comments = $_comments = $comment_ids = array();
foreach ($comments as $key => $comment) {
- if ($key == 'social_items') {
- $_comments[$key] = $comment;
- }
- else {
+ if (is_object($comment)) {
$_comments['id_'.$comment->comment_ID] = $comment;
if ($comment->comment_type == 'social-twitter') {
$comment_ids[] = $comment->comment_ID;
$tweet_comments['id_'.$comment->comment_ID] = $comment;
}
}
+ else { // social items
+ $_comments[$key] = $comment;
+ }
}
// if no tweet comments, get out now

0 comments on commit ac5ae4c

Please sign in to comment.