Created
December 31, 2011 21:36
-
-
Save jmdodd/1545420 to your computer and use it in GitHub Desktop.
Add post format to FeedWordPress syndicated posts
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_post_format_feedwordpress_syndicated_post' ) ) { | |
function ucc_post_format_feedwordpress_syndicated_post ( $data ) { | |
$feed = $data['meta']['syndication_feed']; | |
// Adjust stripos contents as needed. | |
if ( stripos( 'delicious.com', $feed ) !== false ) { | |
$data['tax_input']['post_format'] = 'post-format-link'; | |
} elseif ( stripos( 'tumblr.com', $feed ) !== false ) { | |
$data['tax_input']['post_format'] = 'post-format-aside'; | |
} elseif ( stripos( 'twitter.com', $feed ) !== false ) { | |
$data['tax_input']['post_format'] = 'post-format-status'; | |
} | |
return $data; | |
} } | |
add_filter( 'syndicated_post' , 'ucc_post_format_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