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 get_taxonomies for taxonomies that are linked to multiple post_types #326

Closed kevinpapst closed 1 month ago

kevinpapst commented 1 month ago

Sorry for all the noise, but I keep running into bugs that are related to custom post types.

I assume this wasn't really tested in a while.

So the function get_taxonomies is not made for taxonomies that are linked to multiple post_types.

I am using the same categories for posts and another post-type. And in this case the old query ALWAYS returned an empty array. This is known, but only documented in a community comment and this TRAC ticket.

As it is documented in trac, the correct method to fetch the taxonomies for a post is get_object_taxonomies.

This fixed the queries and now I see categories in the exported frontmatter 👍