WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#6847 closed defect (bug) (duplicate)

'the_content_rss' hook not working

Reported by: scribu 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)

the_content_rss_filter_when_feed.patch (671 bytes) - added by mystyman 7 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 @scribu7 years ago

  • Owner changed from anonymous to guillep2k, ionfish

comment:2 @scribu7 years ago

  • Owner changed from guillep2k, ionfish to guillep2k

comment:3 follow-up: @mystyman7 years ago

  • Keywords has_patch needs_testing added

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.

comment:4 in reply to: ↑ 3 @skarcha7 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.

comment:5 @fuggi7 years ago

Related to this ticket called "the_content_rss() is used incorrectly in non RSS feed": http://trac.wordpress.org/ticket/3884

comment:6 @ryan7 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

comment:7 @scribu7 years ago

  • Milestone changed from 2.9 to 2.6.1

comment:8 @scribu7 years ago

  • Owner guillep2k deleted

comment:9 @scribu7 years ago

  • Owner set to anonymous

comment:10 @westi7 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

comment:11 @scribu7 years ago

  • Milestone changed from 2.9 to 2.6.2

comment:12 @westi7 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.

comment:13 @tadhg6 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.

comment:14 @lloydbudd6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:15 @lloydbudd6 years ago

  • Resolution set to duplicate
  • Status changed from reopened to closed

comment:16 @gaveideer3 years ago

For the record 8706 is resolved.


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 gaveideer

I think this bug should be a duplicate of 8706 at this point.

Version 0, edited 3 years ago by gaveideer (next)
Note: See TracTickets for help on using tickets.