Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom post types broken since WordPress 4.5.2 #121

Open
imbeingfollowed opened this issue Aug 22, 2017 · 2 comments
Open

Custom post types broken since WordPress 4.5.2 #121

imbeingfollowed opened this issue Aug 22, 2017 · 2 comments

Comments

@imbeingfollowed
Copy link

imbeingfollowed commented Aug 22, 2017

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
Copy link
Contributor

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
Copy link
Contributor

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:

  • write a wp-cli script to update all existing multiple thumbnails to correct the post_type in the meta key
  • provide the SQL statement to do the above for anyone that can't run wp-cli scripts

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.

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

No branches or pull requests

2 participants