• Trahald

    (@trahald)


    I was trying to make a filter hook that edits the RSS content, but the_content_rss filter doesn’t seem to work for me. Here’s my test plugin code:

    function test_function($content='')
    {
    	return 'New content';
    }
    
    add_filter('the_content_rss', 'test_function');

    This works fine for the site content if I replace the_content_rss with the_content, and it also works in the RSS feed if I use the_title_rss, but it doesn’t work for the_content_rss (note that I am force refreshing with cntrl-f5).

    Anyone have any ideas on what the problem might be?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Trahald

    (@trahald)

    Note that I’m using WordPress 2.1.1

    Thread Starter Trahald

    (@trahald)

    Does anyone know anything about this?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Known issue. If you look at the wp-rss2.php file, you’ll find this line:
    <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>

    It should probably be this instead:
    <content:encoded><![CDATA[<?php the_content_rss() ?>]]></content:encoded>

    Chris_K

    (@handysolo)

    Yeah, my feed plugins start with:

    if ( ! is_feed() ) return $content;

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘the_content_rss filter doesn’t work?’ is closed to new replies.