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

Cannot set featured image on regular blog posts #166

Open
bhaal2 opened this issue Dec 16, 2019 · 1 comment
Open

Cannot set featured image on regular blog posts #166

bhaal2 opened this issue Dec 16, 2019 · 1 comment

Comments

@bhaal2
Copy link

bhaal2 commented Dec 16, 2019

I've narrowed it down to being this plugin which is blocking me from setting feature images on regular blog posts which are not part of a product etc. Haven't figured out why yet though.

EDIT: Seems there is no test to see whether it's a post or a product before updating (haven't tested it during post creation) _thumbnail_id

@bhaal2
Copy link
Author

bhaal2 commented Dec 16, 2019

Potentially crude, and I haven't tested to see what else breaks, but for now changing the following line:
if ( ! isset( $mapping[ $meta_key ] ) ) {
To:
if ( ! isset( $mapping[ $meta_key ] ) || get_post_type($post_id) == "post") {
for get, add, update, and delete filters in class-wc-product-tables-backwards-compatibility.php seems to have fixed it.. And the _thumbnail_id also now shows up on the public side.

Soo, a bug, and I doubt this is the proper fix, but hopefully it helps get the ball rolling. And no, even if this is the right fix, I don't know enough about git in order to fork, and setup a pull request for this..

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

1 participant