mAAdhaTTah / wordpress-github-sync

A WordPress plugin to sync content with a GitHub repository (or Jekyll site)
https://wordpress.org/plugins/wp-github-sync/
GNU General Public License v3.0
613 stars 99 forks source link

Fix JSON decode and empty post_date #187

Closed JayWood closed 7 years ago

JayWood commented 7 years ago

This fixes #185

Two issues here.

When the payload comes from GitHub you have to parse_str on the raw data and then access the payload key, that is what retains the JSON. However, in the interest of backwards compatibility I left the same old method there, but only ran the new method if it failed.

As for the date - it was due to the post_date being empty prior to being passed to get_gmt_from_date so now if it's empty, but is still set, we will now use current_time() to get the WordPress time during import, and no longer pass an empty string to the GMT function.

JayWood commented 7 years ago

Also, noticed I referenced issue 85, not 185 😄 I'm not perfect haha

mAAdhaTTah commented 7 years ago

Looks good! Merging now. Will cut a release to .org today or tomorrow.