#6847 closed defect (bug) (duplicate)
'the_content_rss' hook not working
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
'the_content_rss' filter does not trigger the callback function. Here is an example:
<?php
/*
Plugin Name: TestRSS
Plugin URI:
Description: Test plugin
Version: 0.1
Date: Mar 31th, 2008
Author: Antonio Perez
Author URI:
*/
function test_rss($text)
{
$text = "Hello world";
return $text;
}
add_filter('the_content_rss', 'test_rss');
?>
This error has also been present in version 2.5
Attachments (1)
Change History (17)
#4
in reply to:
↑ 3
@
17 years ago
Replying to mystyman:
It appears that rss2 and atom are run through the_content not the_content_rss. Here is a little patch that should run it through the correct filter hook anyway. needs testing though.
Tested and works for me now. Thanks.
#5
@
17 years ago
Related to this ticket called "the_content_rss() is used incorrectly in non RSS feed": http://trac.wordpress.org/ticket/3884
#10
@
17 years ago
- Keywords has_patch needs_testing the_content_rss filter feed removed
- Milestone changed from 2.6.1 to 2.9
Moving back to 2.9
#12
@
17 years ago
- Milestone 2.6.2 deleted
- Resolution set to invalid
- Status changed from new to closed
Closing as invalid.
the_content_rss hook is called by the_content_rss function.
It sbhould not be called by the_content function that should as it does not call the_content hook.
#13
@
16 years ago
westi: You're right about how it should work, but the problem is that apparently the_content_rss hook doesn't always get called--i.e. with Atom or RSS2 feeds. It looks to me like mystyman's patch addresses the problem that's caused by
http://core.trac.wordpress.org/ticket/8706
I think this bug should be a duplicate of 8706 at this point.
It appears that rss2 and atom are run through the_content not the_content_rss. Here is a little patch that should run it through the correct filter hook anyway. needs testing though.