Add-ons and Filters

Popular Add-Ons

Many add-ons and filters have been developed for or by the FeedWordPress community. Here are some of the most commonly used.

  • Add Attribution for FeedWordPress provides a convenient interface for adding attribution or other boilerplate text to syndicated posts without having to edit your WordPress theme.
  • Add-on: Limit Posts By Date allows you to filter out syndicated posts by their date, age, or the number of incoming posts.
  • Add-on: Limit Size of Posts allows you to set upper limits on the length of posts, making FeedWordPress display a shortened excerpt when a syndicated post exceeds a given number of characters, words or sentences.
  • Strip HTML for FeedWordPress is an add-on module which allows you to automatically strip out HTML tags from the body of posts that FeedWordPress has syndicated.
  • Add-on: Open links in new windows is an add-on module which automatically rewrites links within the content of syndicated posts, so that the links within the body of the post will open in a new browser window.

Developing Add-Ons and Filters

FeedWordPress creates hooks using the WordPress plugin architecture. You can exploit these to write PHP plugins that alter FeedWordPress’s behavior or filter incoming posts. See How do I write add-ons for FeedWordPress? for a quick-start guide on how to prepare the modules.

API

Filters

  • syndicated_item — applied to each item coming off the Atom/RSS newsfeed; allows you to alter any XML field or to filter out this item and skip ahead to the next post
  • syndicated_post — applied to each potential post for the WordPress database; allows you to alter any database field or to filter out this item and skip ahead to the next post

Post Content and Data

  • syndicated_item_title — filter, alter or act on the post title for each incoming post being considered for syndication

  • syndicated_item_author — filter, alter or act on the author name and author meta-data for each incoming post being considered for syndication

  • syndicated_item_content — filter, alter or act on the HTML content for each incoming post being considered for syndication

  • syndicated_item_excerpt — filter, alter or act on the text excerpt for each incoming post being considered for syndication

  • syndicated_item_categories — applied to an array of category names representing the categories provided for that individual post by the source feed

  • syndicated_item_tags — applied to an array of category names representing the inline tags provided for that individual post by the source feed

  • syndicated_item_published — filter, alter or act on the Unix-epoch timestamp for the first publication of a syndicated post

  • syndicated_item_created — filter, alter or act on the Unix-epoch timestamp for the creation of a syndicated post

  • syndicated_item_updated — filter, alter or act on the Unix-epoch timestamp for the most recent update to a syndicated post

  • syndicated_item_guid — filter, alter or act on the guid (globally unique identifier) that identifies a particular syndicated post

Post Meta-Data

Post Processing

Post Display

Feed Data

Actions

Add-Ons Awaiting Development

These add-ons represent add-on features that have been commonly requested, but which are better provided through an add-on than through additions to the FeedWordPress core code. If you would like to support the development of any of these features, you can do so with a small donation to help cover the costs of the time for development and testing. If you need an add-on or filter to implement a feature that isn’t listed here, you may be
interested in the custom development services available to FeedWordPress users.

  • Alternative Caching Options — an add-on module to allow you to store SimplePie feed cache data in locations other than the WordPress options database table — in a separate table, in another database, or in flat files in the filesystem.

This page is a Wiki! Log in or register an account to edit.

4 thoughts on “Add-ons and Filters

  1. My rss feed has a source for each item, and I cannot get Add Attribution to display the item source-name. It always defaults back to the name of the feed. I am using [source-name], but it still won’t show the right attribution for the item. Please help!

  2. I’m using FeedWordPress to aggregate, and it’s terrific. The particular tweak I need to make is that I want to show only an excerpt of each aggregated post, with links back to the original.

    Specifically, I’d like to include just about 250 characters from each content item that’s aggregated. My goal is to encourage readers to visit the original post. I can’t do this just with formatting, because I want it to apply to the blog’s RSS feed as well.

    I’m using the Add Attribution add-on to pre-pend and post-pend information and links, but for the content itself it seems I need a filter. I’m new to filters and actions. Here’s what I’ve come up with (borrowing a truncation function I located and attributed):

    add_filter(
        /*hook=*/ 'syndicated_item_content',
        /*function=*/ 'bbd_truncate_content',
        /*priority=*/ 1001,
        /*arguments=*/ 1
    );
    function bbd_truncate_content ($content) {
        if (is_syndicated()) {
            $content = myTruncate($content, 250);
        }
        return $content;
    }
    function myTruncate($string, $limit, $break=" ", $pad="...") {
      if(strlen($string) <= $limit) return $string;
      if(false !== ($breakpoint = strpos($string, $break, $limit))) {
          if($breakpoint < strlen($string) - 1) {
            $string = substr($string, 0, $breakpoint) . $pad;
          }
      }
      return $string;
    }
    

    This doesn’t have any effect, so I’m doing something wrong. Can anyone point me in a good direction?

    Thanks very much for your help.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>