-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block API: Allow block registration without category #22280
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aduth
added
[Feature] Block API
API that allows to express the block paradigm.
[Status] In Progress
Tracking issues with work in progress
labels
May 11, 2020
aduth
commented
May 11, 2020
Size Change: +2.62 kB (0%) Total Size: 827 kB
ℹ️ View Unchanged
|
youknowriad
reviewed
May 12, 2020
youknowriad
approved these changes
May 12, 2020
Search implementation leverages block category, which may be absent. It did not actually require changes to the implementation to support, but the test case can help assure this continues to be supported into the future.
Updated in 043ebc5.
Added a test case in bf5f678. The implementation appears to handle it okay. The test case should at least help assure there's no regressions in the future. |
gziolo
added
the
Needs Dev Note
Requires a developer note for a major WordPress release cycle
label
Jun 3, 2020
I added the |
6 tasks
tellthemachines
removed
the
Needs Dev Note
Requires a developer note for a major WordPress release cycle
label
Nov 18, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Alternative to: #22192
This pull request seeks to update block registration to allow for the omission of a category in block settings. This differs from #22192 in that it avoids treating "Uncategorized" as a formalized, default category for blocks. Instead, it simply allows blocks to lack a
category
property value. The "downside" here is that it then relies on each individual UI of the editor to account for the potential absence of category. Currently, this appears to affect only the Inserter and the Block Manager components. Note that changes would be required in #22192 as well for these components, so there's not a significant difference between the approaches in this regard.Status: In Progress. Remaining tasks:Testing Instructions:
To test, you need to register a block type which does not have an assigned category, or which has an invalid category. The easiest way I found to do this was to locally modify the settings of a core block, e.g. the paragraph block, to remove or alter the "category" field.
Then, verify that the block is shown under the "Uncategorized" categorizations within the block inserter and Block Manager modal.
Inserter:
Block Manager:
Ensure unit tests pass: