-
-
Notifications
You must be signed in to change notification settings - Fork 129
Export drafts #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export drafts #108
Conversation
benbalter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. If it's not too much effort, it'd be good to add a test as well.
|
|
||
| $posts = array(); | ||
| $post_types = apply_filters( 'jekyll_export_post_types', array( 'post', 'page' ) ); | ||
| $post_types = apply_filters( 'jekyll_export_post_types', array( 'post', 'page', 'revision' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this return all revisions (including those for published posts) or only revisions for unpublished posts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all revisions, but I don't think it's a bad thing. To my mind, if WP deemed something important enough to keep, so should the exporter (why risk missing something.. one could realize it too late after one has deleted one's original WP DB). It's just going to sit in the _drafts folder so no harm done anyway, worst case simply delete what you don't want from there after the export...
|
Added test |
|
Nice! Thanks for taking the time to clean up the tests as well! |
|
Sure thing Ben. Why don't you publish a new version so I can verify it works end to end? |
Addresses #107.
The draft filenames can come out a bit too verbose but seeing as some revision objects have strange properties (like no id) I felt it better to err on the side of safety so drafts aren't overridden and lost.
Verified on:
Azure Web App (IIS on Windows)
PHP 5.6
Project Nami (WordPress on MS SQL Server) 4.8.1
Twenty Sixteen Theme 1.3
Site: https://www.ohadsoft.com