Skip to content

Instantly share code, notes, and snippets.

@bueltge
Created May 30, 2011 07:00
Show Gist options
  • Save bueltge/998531 to your computer and use it in GitHub Desktop.
Save bueltge/998531 to your computer and use it in GitHub Desktop.
Example for add a Custom Post Type to the WordPress Post Feed
add_action( 'request', array( &$this, 'add_to_feed' ) );
// add to post-feed
function add_to_feed($request) {
if ( isset($request['feed']) && !isset($request['post_type']) ) {
$request['post_type'] = get_post_types( $args = array(
'public' => true,
'capability_type' => 'post'
) );
}
return $request;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment