Created
December 19, 2011 17:02
-
-
Save jmdodd/1497987 to your computer and use it in GitHub Desktop.
Filter FeedWordPress syndicated posts into custom post types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'ucc_cpt_feedwordpress_syndicated_post' ) ) { | |
function ucc_cpt_feedwordpress_syndicated_post ( $data ) { | |
$feed = $data['meta']['syndication_feed']; | |
// Adjust stripos contents as needed. | |
if ( stripos( 'colourlovers.com/rss/lover/username/palettes/favorites', $feed ) !== false ) { | |
$data['post_type'] = 'colourlovers-palette'; | |
} elseif ( stripos( 'colourlovers.com/rss/lover/username/colors/favorites', $feed ) !== false ) { | |
$data['post_type'] = 'colourlovers-color'; | |
} elseif ( stripos( 'delicious.com/v2/rss/jmdodd', $feed ) !== false ) { | |
$data['post_type'] = 'delicious-link'; | |
} | |
return $data; | |
} } | |
add_filter( 'syndicated_post' , 'ucc_cpt_feedwordpress_syndicated_post' ); | |
/* | |
Copyright 2011 Jennifer M. Dodd (email: jmdodd@gmail.com) | |
Released under the GPLv2 (or later). | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment