function Manage_posts_custom_column($column_name, $post_ID) { if ($column_name == 'al2fb') { $charset = get_bloginfo('charset'); $post = get_post($post_ID); $user_ID = self::Get_user_ID($post); $link_ids = get_post_meta($post->ID, c_al2fb_meta_link_id, false); if ($link_ids) { foreach ($link_ids as $link_id) { try { $page_id = WPAL2Int::Get_page_from_link_id($link_id); $link = WPAL2Int::Get_fb_permalink($link_id); $info = WPAL2Int::Get_fb_info_cached($user_ID, $page_id); echo '<a href="' . $link . '" target="_blank">' . htmlspecialchars($info->name, ENT_QUOTES, $charset) . '</a><br />'; } catch (Exception $e) { echo htmlspecialchars($e->getMessage(), ENT_QUOTES, $charset); } } } else { echo '<span>' . __('No', c_al2fb_text_domain) . '</span>'; } $link_id = get_post_meta($post->ID, c_al2fb_meta_link_id, true); if ($link_id && self::Is_recent($post)) { // Show number of comments if (get_user_meta($user_ID, c_al2fb_meta_fb_comments, true)) { $count = 0; $fb_comments = WPAL2Int::Get_comments_or_likes($post, false); if ($fb_comments && $fb_comments->data) { $count = count($fb_comments->data); } echo '<span>' . $count . ' ' . __('comments', c_al2fb_text_domain) . '</span><br />'; } // Show number of likes if ($post->ping_status == 'open' && get_user_meta($user_ID, c_al2fb_meta_fb_likes, true)) { $count = 0; $fb_likes = WPAL2Int::Get_comments_or_likes($post, true); if ($fb_likes && $fb_likes->data) { $count = count($fb_likes->data); } echo '<span>' . $count . ' ' . __('likes', c_al2fb_text_domain) . '</span><br />'; } } } }