-
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
Add plugins styles customization support #37208
Conversation
…ustom_post_type() (WordPress#36584) * Add caching to WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type Refactor `WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type` to add caching to the `wp_global_styles` post type lookup, and also to remove the duplicate code added in `gutenberg_add_active_global_styles_link`. Fixes WordPress#36574 * Add unit tests * Use the correct query filter * Use wp_cache_set instead of wp_cache_add. * Remove the filter when finished. * Simplify the if blocks
* Let's check if the scrollContainer can be found before trying to use its property `scrollTop`. * Moving default top position to a const and moving the comment.
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Lucisu! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
I just noticed I added the commit to the 12.0.2, I'll try to fix it later |
Hey there @Lucisu, thank you for this PR! |
Hello, @skorasaurus! I'm sorry for the delay. So, I remember that when I sent this pull request, I was developing a custom plugin that would inject some content out of the user data in the theme.json in runtime. I didn't find any filters to accomplish this, so I had to create a workaround, and not very beautiful. Please, let me know if it makes sense. Thank you! |
Hi, @Lucisu The #44015 introduced a few hooks that might serve the same purpose. Handbook: https://developer.wordpress.org/block-editor/reference-guides/filters/global-styles-filters/. Let me know if we can close this PR. Thanks, George |
Hey there! Yep, that will solve the problem! Thanks ;) |
Description
This pull request adds three filters that allow plugins to customize Global Styles and theme.json files.
It solves #37206
How has this been tested?
Just added filters, so my tests were just loading everything, pretty straightforward.
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).