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

You can no longer use unregisterBlockType() with core blocks #4699

Closed
sheepzilla opened this issue Jan 26, 2018 · 3 comments
Closed

You can no longer use unregisterBlockType() with core blocks #4699

sheepzilla opened this issue Jan 26, 2018 · 3 comments
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Extensibility The ability to extend blocks or the editing experience [Priority] High Used to indicate top priority items that need quick attention [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@sheepzilla
Copy link

sheepzilla commented Jan 26, 2018

Issue Overview

After the update to 2.1.0 the sample code to unregister core blocks taken from the Gutenberg handbook no longer works as expected.
https://wordpress.org/gutenberg/handbook/extensibility/#using-a-whitelist

It looks like the initial registering of the blocks has been moved in the following commit:
e694f6a

Can the docs be updated to reflect this change?

Steps to Reproduce (for bugs)

  1. Add whitelist code from https://wordpress.org/gutenberg/handbook/extensibility/#using-a-whitelist to a theme or plugin and load in the admin
  2. Observe that while editing a page all blocks are still available.

Expected Behavior

Expected behaviour would be for only the specified blocks to be available.

Current Behavior

All blocks available

@gziolo gziolo added the [Feature] Extensibility The ability to extend blocks or the editing experience label Jan 27, 2018
@taija
Copy link

taija commented Jan 30, 2018

Also seeing this issue. Any workarounds?

@gziolo
Copy link
Member

gziolo commented Jan 31, 2018

I might break something with the recent refactoring. I will debug later this week and hopefully push a patch. Aplogies for temporary inconvenience :)

@gziolo gziolo self-assigned this Jan 31, 2018
@gziolo gziolo added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks [Priority] High Used to indicate top priority items that need quick attention labels Feb 1, 2018
@gziolo
Copy link
Member

gziolo commented Feb 5, 2018

This is the same issue as described and explained by @youknowriad in #4848. We started exploring different ways of registering blocks to come up with a much reliable solution. You can see what has been proposed already in #2751. Code explorations are done in #4841. So the idea would be to have full control over which blocks are going to be registered on PHP side.

I will close this one as a duplicate of #4848, but I would expect API change really soon so this is won't fix.

@gziolo gziolo closed this as completed Feb 5, 2018
@designsimply designsimply added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Extensibility The ability to extend blocks or the editing experience [Priority] High Used to indicate top priority items that need quick attention [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants