-
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
[Question] Can core blocks be extended? #5785
Comments
There are a couple of ways how core blocks can be extended or modified. You can see more in here: https://github.com/WordPress/gutenberg/blob/master/docs/extensibility/extending-blocks.md. We provide a few hooks which make it possible to change core blocks. We are still working on making it more robust so it is still considered experimental. However, we encourage every plugin developer to give it a try. It seems like in the case you mentioned |
Thanks for your reply, it definitely points me in the right direction.
I'm my case I'd say it's both data and UI, the way my plugin currently
works is that it adds a text input to the top of the taxonomy list (UI) and
it lets you filter the terms based on what you type (data?). I'll start
playing around with the filters and report my experience.
…On Fri, 30 Mar 2018, 10:39 Grzegorz (Greg) Ziółkowski, < ***@***.***> wrote:
There are a couple of ways how core blocks can be extended or modified.
You can see more in here:
https://github.com/WordPress/gutenberg/blob/master/docs/extensibility/extending-blocks.md
.
We provide a few hooks which make it possible to change core blocks. We
are still working on making it more robust so it is still considered
experimental. However, we encourage every plugin developer to give it a try.
It seems like in the case you mentioned blocks.registerBlockType would be
the filter to look at. It allows to override edit implementation of the
core block. It might be a lot of work to reimplement the edit experience
with your own logic. Can you share more details what exactly should change
in the logic of the existing blocks with your plugin? Is it about UI or
data or both?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5785 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAoXUiEEraTseEOWahJC3ENGrOXldY58ks5tjf1KgaJpZM4S6Nhb>
.
|
I think I've hit my first roadblock, I tried using the function getBlockSettings( settings, blockName ) {
console.log(blockName);
return settings;
}
wp.hooks.addFilter(
'blocks.registerBlockType',
'post-taxonomy-filter/test-function',
getBlockSettings
); However the list that comes back are block names (which makes sense) however I need to extend one of the core components in the sidebar ( Can I still extend it somehow? |
To answer the original question, Riad has a bunch of information here as well: https://riad.blog/2017/10/16/one-thousand-and-one-way-to-extend-gutenberg-today/ Closing this ticket as part of some repository management. Support questions are most welcome in the WordPress core slack, channel #core-editor, or in the plugin support forum. |
Related issue: #6023. |
Is it possible to 'extend' the functionality of core blocks? If not, are there any plans to allow plugins to do so?
My use case is that I'm trying to integrate my Category Filter plugin to work with Gutenberg however I'm not sure how to do so without directly messing with the
TaxonomyPanel
component.The text was updated successfully, but these errors were encountered: