Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.