Title: Patch for adding links
Last modified: August 21, 2016

---

# Patch for adding links

 *  Resolved [ravloony](https://wordpress.org/support/users/ravloony/)
 * (@ravloony)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/patch-for-adding-links/)
 * Hi,
 * I had an issue with this plugin that apparently it was not showing recent posts.
   It turned out that it was only getting “status”, “photo” and “video” post types,
   not “link” ones.
 * So I added the code for that:
 *     ```
       --- a/classes/class-rfb.php
       +++ b/classes/class-rfb.php
       @@ -125,12 +125,12 @@ class RFB {
                       if(!$fb->getUser()) return false;
   
                       $apiResult = $fb->api(trim($opts['fb_id']) . '/feed?with=message&limit=250');
       -
       +
                       if(!$apiResult or !is_array($apiResult) or !isset($apiResult['data']) or !is_array($apiResult['data'])) { return false; }
   
                       $data = array();
                       foreach($apiResult['data'] as $p) {
       -                       if(!in_array($p['type'], array('status', 'photo', 'video'))) { continue; }
       +                       if(!in_array($p['type'], array('status', 'photo', 'video','link'))) { continue; }
                               //split user and post ID (userID_postID)
                               $idArray = explode("_", $p['id']);
   
       @@ -143,6 +143,12 @@ class RFB {
                               } elseif($p['type'] == 'video') {
                                       $post['image'] = $p['picture'];
                                       $post['content'] .= "\n\n {$p['link']}";
       +                       } elseif($p['type'] == 'link') {
       +                                                                if (isset($p['picture']))
       +                               $post['image'] = $p['picture'];
       +                                                                if (isset($p['description']))
       +                               $post['content'] .= "\n\n {$p['description']}";
       +                                                                $post['content'] .= "\n\n {$p['link']}";
                               } else {
                                       $post['image'] = null;
                               }
       ```
   
 * Best regards,
 * [http://wordpress.org/extend/plugins/recent-facebook-posts/](http://wordpress.org/extend/plugins/recent-facebook-posts/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/patch-for-adding-links/#post-3845373)
 * Hi Ravloony,
 * I will include the ‘link’ post type in the next plugin update as well. Thanks.
   🙂

Viewing 1 replies (of 1 total)

The topic ‘Patch for adding links’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/recent-facebook-posts_eae9f9.svg)
 * [Recent FB Posts](https://wordpress.org/plugins/recent-facebook-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recent-facebook-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recent-facebook-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/recent-facebook-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recent-facebook-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recent-facebook-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/patch-for-adding-links/#post-3845373)
 * Status: resolved