Skip to content
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

Merged
merged 2 commits into from
Nov 13, 2015
Merged

Custom CSS: Add jetpack_custom_css_pre_post_id filter. #2955

merged 2 commits into from
Nov 13, 2015

Conversation

iandunn
Copy link

@iandunn iandunn commented Nov 5, 2015

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 call Jetpack_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.

This allows other plugins to override the post where Custom CSS is saved.
@iandunn iandunn added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Custom CSS labels Nov 5, 2015
@kraftbj kraftbj added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Nov 5, 2015
@kraftbj
Copy link
Contributor

kraftbj commented Nov 5, 2015

Noting this is a blocker for a WordCamp.org project: https://wordpress.slack.com/archives/meta/p1446684533000005

@dereksmart dereksmart added this to the 3.8.1 milestone Nov 5, 2015
*
* If the callback function returns a non-null value, then post_id() will immediately
* return that value, instead of retrieving the normal post ID.
*
Copy link
Member

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!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, good catch :)

@dereksmart dereksmart added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Nov 13, 2015
@dereksmart
Copy link
Member

👍

dereksmart added a commit that referenced this pull request Nov 13, 2015
Custom CSS: Add jetpack_custom_css_pre_post_id filter.
@dereksmart dereksmart merged commit 29609e7 into Automattic:master Nov 13, 2015
@dereksmart dereksmart removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 13, 2015
@anomiex anomiex mentioned this pull request Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Custom CSS Touches WP.com Files [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants