Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Filter to allow plugins override block attributes #11730
Add a filter so plugins and themes can override block attributes.
Why is this needed?
Dynamic blocks, rendered server side keep their values in block attributes. Some of those attributes might be texts printed in the front-end to be read by people. This kind of strings should be available for translation.
How has this been tested?
This has been tested in WPML with following code example (to translate dynamic strings created with ACF Blocks beta).
Types of changes
Add a new filter
left a comment
@pento, I didn't follow PHP based hooks for Gutenberg. Could you double check this one?
The use case described makes sense. What I'm not quite sure is how it relates to #8912 which also tries to integrate WPML plugin using reusable blocks:
referenced this pull request
Nov 14, 2018
left a comment
This needs to be fixed:
Can we also consolidate changes proposed in #8912 to avoid introducing another more targeted hook:
I guess, we would have to pass a post id or even a full object.
about passing post id: I am not sure if I understood, but I think post is not available in this scope (it is in globals, this is what you meant? to take it from global? if so, it could be redundant: hooked filter will have access to global as well so no need to pass it)
about Trac: I don't know how to propose it there, could you give me a hand?
As for the ticket, make sure the type is "enhancement" and the version is 5.0.
Creating a patch is a little bit different than creating a PR here on GitHub.
You can clone the Git repository from develop.git.wordpress.org. Make sure to check out the 5.0 branch. Then, apply the changes from this PR to
Make sure to change the
Also, I'd replace
After that, create a patch using
You can include the same description from this PR when creating the ticket. You can also link to this PR for full context.
Let me know if you need any help during the whole process! I'll definitely keep an eye open on new tickets :-)
Hi @swissspidy thank you for detailed instructions but I can't connect to git server. Is the url correct? What protocol should I use?
this is what I tried:
@swissspidy for https I didn't make any difference, but for ssh:// there is some progress. Looks like I need to have access granted, but how?