beaulebens / keyring-social-importers

A collection of importers which pull your content back from social networks, and into your own WordPress install.
32 stars 17 forks source link

Core: Add option to set imported posts to private #5

Closed onomiko closed 5 years ago

onomiko commented 8 years ago

Will you add the option to automatically set the post status to PRIVATE, as does the Facebook Importer? I'm unable to hack it myself and figure it'll be simple for you or someome interested. Thanks!

https://github.com/cfinke/Keyring-Facebook-Importer/blob/master/keyring-facebook-importer/keyring-importer-facebook.php

beaulebens commented 6 years ago

It's not a user-facing option, but you should be able to achieve this via the new filter added in https://github.com/beaulebens/keyring-social-importers/commit/c0e5dd312c8161a53da65a9e95d1b468a3d8a87d

You'd want to do something very loosely along the lines of:

add filter to keyring_importer_posts_pre_insert
loop through $posts (first arg)
set post_status to `private`
return $posts

I'll still likely add some "Advanced" options at some point, so leaving this open.

beaulebens commented 5 years ago

This was added in v1.9