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

Disabling inline image block #12680

Closed
slimmilkduds opened this issue Dec 7, 2018 · 7 comments
Closed

Disabling inline image block #12680

slimmilkduds opened this issue Dec 7, 2018 · 7 comments
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.

Comments

@slimmilkduds
Copy link

Is your feature request related to a problem? Please describe.
The inline block is registered as a paragraph and therefor it cannot be de-registered/black listed.

Describe the solution you'd like
I’d like to be able to black list that block

Describe alternatives you've considered
Removing the entire block. It’s pretty confusing and buggy. And from what I can tell you can the same things with a paragraph + an image block that you float. But this alernative feels a bit too aggressive.

@swissspidy swissspidy added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. [Block] Paragraph Affects the Paragraph Block labels Dec 7, 2018
@HarwinBorger
Copy link

I would like to have this feature to block inline-images as well

@v18
Copy link

v18 commented Jan 10, 2019

I've used the inline image block to add images to lists, like this: #12396 (comment)

@TeemuSuoranta
Copy link

There should be a way to disable inline image block as there can be post types where no images are allowed. Currently I can restrict the block types on post type with the filter allowed_block_types but can't disable inline image block for the post type as long as there is paragraph block.

@zkingdesign
Copy link

Has someone found a solution to this? I'd really want to remove the 'inline image' block.

@raphaelportmann
Copy link

raphaelportmann commented Oct 11, 2019

Inline images are not standalone blocks but a format type for the RichText Component (which is used for example in the paragraph block).
To disable usage of the inline image format you can use the following code to unregister them:
wp.richText.unregisterFormatType('core/image')

@erikjoling
Copy link

I can confirm this works (Gutenberg v6.6). Thanks for sharing @raphaelportmann

@paaljoachim
Copy link
Contributor

paaljoachim commented Feb 7, 2021

Based on the reply from @raphaelportmann I will go ahead and close the issue as a solution has been found. Please reopen if I am mistaken.

@mkaz Marcus do we need to add additional information into the documentation?

mkaz added a commit that referenced this issue Feb 26, 2021
Adds a new question/answer to rich text documentation for disabling a
specific format type either by using allowedFormts or unregister a
format.

Related: #12680
mkaz added a commit that referenced this issue Mar 27, 2021
Adds a new question/answer to rich text documentation for disabling a
specific format type either by using allowedFormts or unregister a
format.

Related: #12680
mkaz added a commit that referenced this issue Mar 27, 2021
* Add section for disabling specific format types

Adds a new question/answer to rich text documentation for disabling a
specific format type either by using allowedFormts or unregister a
format.

Related: #12680

* Update allowedFormats as prop to component

* Add pointer to example above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

9 participants