-
Notifications
You must be signed in to change notification settings - Fork 815
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
Custom CSS: Add jetpack_custom_css_pre_post_id filter. #2955
Custom CSS: Add jetpack_custom_css_pre_post_id filter. #2955
Conversation
This allows other plugins to override the post where Custom CSS is saved.
Noting this is a blocker for a WordCamp.org project: https://wordpress.slack.com/archives/meta/p1446684533000005 |
* | ||
* If the callback function returns a non-null value, then post_id() will immediately | ||
* return that value, instead of retrieving the normal post ID. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add @module custom-css
in there, like in #2852? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, good catch :)
👍 |
Custom CSS: Add jetpack_custom_css_pre_post_id filter.
This allows other plugins to override the post where Custom CSS is saved.
My use case for this is the Remote CSS plugin for WordCamp.org, which needs a way to sanitize untrusted CSS.
With this filter, I can create a second
safecss
post and callJetpack_Custom_CSS::save()
to sanitize and save my untrusted CSS to that second post, while still allowing Jetpack's regular Custom CSS post to function simultaneously.