[wp-trac] [WordPress Trac] #12943: Feeds for custom post types
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 9 21:09:06 UTC 2010
#12943: Feeds for custom post types
-----------------------------+----------------------------------------------
Reporter: matthewhollett | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 3.0
Component: Feeds | Version: 3.0
Severity: normal | Keywords:
-----------------------------+----------------------------------------------
Comment(by rovo89):
Using this in a plugin, the default feed will return the posts of all
types:
{{{
function myfeed_request($qv) {
if (isset($qv['feed']))
$qv['post_type'] = get_post_types();
return $qv;
}
add_filter('request', 'myfeed_request');
}}}
If you use it like that, the `post_type` parameter in the URL will be
ignored, so you might want to add `&& !isset($qv['post_type'])`. Also,
`get_post_types()` can be called with attributes that the post type needs
have, such as `publicly_queryable => true`. Or you could use a hardcoded
list. Or only apply the filter if some special GET parameter was passed.
Or... ;)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12943#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list