voceconnect / multi-post-thumbnails

Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
143 stars 63 forks source link

Custom post types broken since WordPress 4.5.2 #121

Open imbeingfollowed opened 7 years ago

imbeingfollowed commented 7 years ago

Hi Chris,

As per our email:

I suspect at least part of the issue is that $post ->post_type is now an array. Use get_post_type() instead.

You can get more info here:

https://wordpress.org/support/topic/bugfix-bug-with-multiple-post-types-wp-4-5/

Thanks

chrisscott commented 7 years ago

Thanks @imbeingfollowed. Setting post_type as an array hasn't been a supported option for quite a while now.

I'm working on a PR for this and will let you know when I get it done (likely tomorrow) so you can test, if possible.

chrisscott commented 7 years ago

I finally had a chance to look at this today and here's what I'm working on as a plan forward to handle this case where an array was used as the post_type instead of a string:

Once this is done, you'd be able to run the cli script or SQL and then change your code that registers the thumbnails to use a string for post_type instead of an array.

The end result is that this will fix any existing thumbnails and then use the currently supported method of registering the thumbnail so it won't be a problem going forward either.