Open coreyworrell opened 4 months ago
cc @ellatrix
How can we get a working alternative of the removed hook
core/editor/custom-class-name/with-inspector-control
?
Or how can we replace / hook into any control of Inspektor Control?
Yes, all these controls moved to a single filter for performance reasons. Technically I guess we could add a dummy item to that filter, and check for removal. Would this still be useful to fix this late? Are you using the GB plugin, or only core WP?
Ideally we need a new block supports API where plugins can also deregister block support items.
Yes, all these controls moved to a single filter for performance reasons. Technically I guess we could add a dummy item to that filter, and check for removal. Would this still be useful to fix this late?
I think filters, actions or (I prefer to say) hooks would be really helpfull. And of course, it would be really nice, to inform plugin and theme developers, if such things changes BEFORE added to core.
Are you using the GB plugin, or only core WP?
Mainly the core WP. The GB plugin only for testing and diffing
Ideally we need a new block supports API where plugins can also deregister block support items.
I think a new API would not solve existing issues. Better documentation and changing carefully the core, which means more testing against most used popular plugins and themes, may be better. If there would be a new API, than it should be simpler, easier to understand and learn and well documented with many examples.
Any update on this? It's been a couple months and we're still having to deal with the duplicated input issue.
Description
In older version of Gutenberg we could replace the "Additional CSS Class(es)" field with our own (with autocomplete for example) by simply using something like:
Now core does not add the
core/editor/custom-class-name/with-inspector-control
filter, so theremoveFilter
code above does not remove the custom class name field, so we end up with a duplicate field. This seems to be the commit that changes it: https://github.com/WordPress/gutenberg/commit/a9cbc06d5e55ebf1b5255edd832809bd684b2c9fThis affects our Block Class Autocomplete plugin (source) and the more popular EditorsKit plugin (source).
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes