benbalter / wordpress-to-jekyll-exporter

One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Jekyll (or Hugo or any other Markdown and YAML based site engine).
https://ben.balter.com/wordpress-to-jekyll-exporter
GNU General Public License v3.0
1.04k stars 130 forks source link

fix passing ID instead of id #323

Closed kevinpapst closed 1 month ago

kevinpapst commented 1 month ago

Depending on the PHP version the old code has different outcomes. In my situation $post->id is always an empty string.

The correct field name is ID, see https://developer.wordpress.org/reference/classes/wp_post/

As you already use $post->ID in other places of the class, this fact is likely not new 😁

benbalter commented 1 month ago

Thanks for these fixes. While maintained, some of the code is 12+ years old at this point, and PHP and WordPress has changed a lot over that time.

kevinpapst commented 1 month ago

Yeah, I thought we fix it for the next person. In the next few weeks more people will think about migrating their WP sites 😁