Filter hook for RSS Widget Item Titles and Content

  1. Vlad Lasky


    I am using the RSS Widget to display Twitter tweets in the sidebar of my Blog.

    For those that don't know, you can create an RSS feed from a Twitter Account using the following URL:


    One annoying thing is that that Twitter prefixes every tweet with the name of the Twitter account. i.e. the RSS widget will display:

    *TwitterAccountName: Latest Tweet
    *TwitterAccountName: Previous Tweet
    *TwitterAccountName: ...

    This prefix is redundant as I have already described this in the RSS Widget title setting.

    I would like to remove the Twitter account name prefix by creating a filter, but the WordPress standard RSS Widget has no filter hook.

    It would be really easy to add one and I propose the name s 'widget_rss_item_title' and 'widget_rss_item_content'

    These could either accept one parameter - a string containing the RSS text, or two parameters - a string containing the RSS text and a string containing the RSS widget title. That way, the filter could be written to target some RSS widgets but not others.

    Here is an example of how it would work in my case:

        function filter_twitter_prefix($rss_item_title)
            return preg_replace('/^TwitterAcctName: */i', '', $rss_content);
        add_filter( 'widget_rss_item_title', 'filter_twitter_prefix' );
    Posted: 8 years ago #
  2. Binary Options


    Hei, you can use this function:

    function wp_echoTwitter($username){
    $tweet = fetch_rss("http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1");
    echo $tweet->items[0]['atom_content'];

    <?php wp_echoTwitter($usernamer); ?>

    Posted: 7 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    5 Votes
  • Status

    This idea is under consideration