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 a filter for programmatically adding entries for Safelist #4343
Comments
The following should work for themes and plugins wanting to modify the safelist for RUCSS compatibility:
By way of documentation:
|
Note on the above... it will work. It will also actually update the wpr safelist setting next time the WPR settings page is loaded (as it filters on the
Would be an [XS] item. Thoughts? Meanwhile the save to wpr options can be avoided by checking for being on the rocket admin page and returning early:
|
For our other options, we always use a separate, additional filter for custom/3rd parties. Possibly it's a good approach to continue this? Also, it avoids tying it to the option itself, if for any reason in the future we change option name or anything like that. |
Is there a similar filter of "pre_get_rocket_option_remove_unused_css_safelist" but for Optimize CSS? some themes need it to avoid a high CLS while using Optimize CSS such as Elementor. Excluding files does not currently help much. |
related question from a 3rd party developer: https://secure.helpscout.net/conversation/1662864389/301553/ |
Currently, there is no filter to programmatically safelist selectors for the Remove Unused CSS option.
Such filter could be useful for compatibility development in 3rd-party plugins/themes.
Related request: https://secure.helpscout.net/conversation/1609150673/289293
Slack: https://wp-media.slack.com/archives/C029G1B5HD2/p1631172880106900
The text was updated successfully, but these errors were encountered: