Last active
August 29, 2015 14:17
-
-
Save peterwilsoncc/088c090cfe7e5b3104c9 to your computer and use it in GitHub Desktop.
Keyring social importer - set post type
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
--- keyring-importer-instagram.php | |
+++ (clipboard) | |
@@ -55,7 +55,11 @@ | |
// First import starts from now and imports back to day-0. | |
// Auto imports start from the most recently imported and go up to "now" | |
+ | |
+ $post_type = apply_filters( 'keyring_post_type', 'post', static::SLUG ); | |
+ | |
$latest = get_posts( array( | |
+ 'post_type' => $post_type, | |
'numberposts' => 1, | |
'orderby' => 'date', | |
'order' => $order, | |
@@ -134,6 +138,7 @@ | |
$tags = array_merge( $tags, $post->tags ); | |
// Other bits | |
+ $post_type = apply_filters( 'keyring_post_type', 'post', static::SLUG ); | |
$post_author = $this->get_option( 'author' ); | |
$post_status = 'publish'; | |
$instagram_id = $post->id; | |
@@ -150,6 +155,7 @@ | |
'post_content', | |
'post_title', | |
'post_status', | |
+ 'post_type', | |
'post_category', | |
'geo', | |
'tags', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment