Skip to content

Conversation

@ohadschn
Copy link
Contributor

@ohadschn ohadschn commented Sep 5, 2017

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

Copy link
Owner

@benbalter benbalter left a 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' ) );
Copy link
Owner

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?

Copy link
Contributor Author

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...

@ohadschn
Copy link
Contributor Author

ohadschn commented Sep 8, 2017

Added test

@benbalter
Copy link
Owner

Nice! Thanks for taking the time to clean up the tests as well!

@benbalter benbalter merged commit f31bc5a into benbalter:master Sep 8, 2017
@ohadschn
Copy link
Contributor Author

ohadschn commented Sep 8, 2017

Sure thing Ben. Why don't you publish a new version so I can verify it works end to end?

@benbalter benbalter mentioned this pull request Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants