Update post.js to fix bug in metaboxes created for custom non-hierarchical taxonomies #1392
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to fix the bug reported at https://forums.classicpress.net/t/custom-taxonomies-dont-work/5163
The bug is isolated to the non-hierarchical taxonomies’ (i.e. like tags) metaboxes on the edit screen of a custom post type.
Metaboxes on regular posts, and hierarchical taxonomies (i.e. like categories) on any post type work fine. The bug also does not affect non-hierarchical taxonomies added via Quick Edit.
The cause is that, while the correct JavaScript file is being loaded, it is not being initiated. The reason for this is that the code looks for a
div
while, in version 2 of ClassicPress, we replaced a lot of old JavaScript with HTML5 disclosure widgets. So the bugfix here is simply to replacediv
withdetails
on a specific line.