[wp-hackers] Check If I'm in a Feed?

Computer Guru computerguru at neosmart.net
Fri Mar 23 07:23:48 GMT 2007


It's not working.

/*********************************************************
if ( stristr( $_SERVER['REQUEST_URI'], 'feed' ) != FALSE )
	add_filter( 'the_content','NST_CheckRSS' );
*********************************************************/

/*********************************************************
if ( is_feed() )
	add_filter( 'the_content','NST_CheckRSS' );
*********************************************************/

The first code sample - the old code - works just fine. The new code
doesn't.

Requests made to http://server/wordpress/?feed=rss2 _aren't_ kicking off
is_feed()
Nor requests to http://server/wordpress/feed/ or anything else for that
matter.

Tested on WP 2.1 Branch and WP Trunk.


Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/


> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-
> bounces at lists.automattic.com] On Behalf Of Peter Westwood
> Sent: Thursday, March 22, 2007 5:35 PM
> To: wp-hackers at lists.automattic.com
> Subject: Re: [wp-hackers] Check If I'm in a Feed?
> 
> 
> On Thu, March 22, 2007 3:31 pm, Computer Guru wrote:
> > Is there any quick function that let's me check if I'm in a feed
> without
> > me
> > parsing REQUEST_URI?
> >
> > Something like is_home() or something...
> >
> 
> is_feed() [1]
> 
> westi
> 
> [1] http://trac.wordpress.org/browser/trunk/wp-includes/query.php#L107
> --
> Peter Westwood <peter.westwood at ftwr.co.uk>
> http://blog.ftwr.co.uk
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list