Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@peterwilsoncc
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterwilsoncc/088c090cfe7e5b3104c9 to your computer and use it in GitHub Desktop.
Save peterwilsoncc/088c090cfe7e5b3104c9 to your computer and use it in GitHub Desktop.
Keyring social importer - set post type
--- 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