Google Tutor » Shared Items Wordpress Plugin

Feature Request: Name of Blog in Item Listing?

(2 posts)
  1. I would like to feature the name of the Blog that the shared item comes from, but I can't see a tag for that? Author name for group blogs would be good too.

    Am I missing something obvious?

    Posted 3 years ago #
  2. I'm pretty sure I've figured out how to get this feature by editing the shared-items-post.php

    Around line 212 (just before $new_items[] = $new_item;), Add this:

    $rss = $item->get_source();
    $new_item['source_link'] = $rss->get_permalink();
    $new_item['source_title'] = $rss->get_title();

    Also, around line 228 (within the foreach ($new_items as $item) loop), add this:

    $import = str_replace('%SOURCE%', $item["source_title"], $import);
    $import = str_replace('%SOURCELINK%', $item["source_link"], $import);

    And now %SOURCE% and %SOURCELINK% work just like %TITLE% and %LINK% in the plugin options page in WordPress.

    I just played around until I got this to work...use at your own risk. I used this page for reference: http://simplepie.org/wiki/tutorial/how_to_display_previous_feed_items_like_google_reader
    In that example, the relevant variable is called $feed instead of $rss.

    Posted 2 years ago #

Reply

You must log in to post.