JS error with custom post type and gutenberg activated
-
Hi,
when I try to use ngg 3.1.6 in a WP 5.1 install the ngg-post-thumbnail.min.js crashes on custom post types admin edit with gutenberg enabled.
Browser console log:
TypeError: Cannot read property ‘ngg_post_thumbnail’ of undefined
at ngg-post-thumbnail.min.js:141
[…]This is because wp.data.select(“core/editor”).getEditedPostAttribute(“meta”) returns ‘undefined’ on custom post types.
This has been tested with my own custom post type as well as with CPT UI custom post types (to make sure the error wasn’t on my end).
I also already tried to add register_meta ‘ngg_post_thumbnail’ for my custom post type, but that didn’t help. Afaik this shouldn’t be necessary anyway.
I would be happy if someone could provide a quick fix for this issue.
Thank you!
Jan
- The topic ‘JS error with custom post type and gutenberg activated’ is closed to new replies.