-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove heading settings (levels) from core/heading #20213
Comments
I don't recommend that approach. It might be possible to modify the core heading block, but not advisable.I would combine two approaches:
I created a rough example to try it out. See this branch of my test-block: https://github.com/mkaz/test-block/tree/remove-heading |
Hey @mkaz, Thanks for your comment and example. Creating my own block was indeed on my mind, however, for this use case it wasn't viable. The block I am developing is going to be used as a block for my clients, who shouldn't have a choice on heading levels. However, I am also planning to publish the same block on the WP directory, where I want to keep that option open for the end user to choose. For now, I went with a hack to hide the heading options for the sidebar and toolbar using this code: JS
CSS
This works for now, however I wish a native options to disable heading levels will get implemented in the future. |
+1 for option to disable heading levels ;) |
Yea, this would be great. Also perhaps allow renaming? A scenario that we are hitting and I am having a hard time imagining to be uncommon, is that |
+1 |
This is required. |
I achieve this with some CSS included in the backend:
Technically you could still add h1, h5 and h6 in the code editor, but for my use case this is sufficient. |
Copying @michaelMcAndrew's description of this issue at who wrote his issue at #42634
|
This PR by @carolinan |
Hi all,
Thanks ❤️ |
A proposed solution is available in #63535 |
Hey,
I need to remove the heading settings for a project, I assume that is best done using filters?
Using this guide here: https://developer.wordpress.org/block-editor/developers/filters/block-filters/#editor-blockedit it's clear how to add panels to the existing settings, however, it doesn't say anything about removing an existing panel from the inspector.
I have tried something like that to see if existing settings can be changed:
However, this just gives me a blank block.
I would really appreciate some help with this.
Thanks!
The text was updated successfully, but these errors were encountered: