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 deprecation warning in codebase #37163

Merged
merged 5 commits into from
May 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/modules/custom-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function jetpack_load_custom_css() {
function custom_css_loaded() {
_deprecated_hook(
'custom_css_loaded',
'jetpack-$$next-version$$',
'$$next-version$$',
Copy link
Contributor

@coder-karen coder-karen May 6, 2024

Choose a reason for hiding this comment

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

This is what is causing the build to fail at the moment (with an 'Unexpected $$next-version$$ token' error).

For this to work, everything needs to be on one line as per the docs here - https://github.com/Automattic/jetpack/blob/trunk/projects/packages/README.md#package-version-annotations:

So this should work:

// translators: %s is a link to the WordPress.org documentation.
_deprecated_hook( 'custom_css_loaded', 'jetpack-$$next-version$$', 'WordPress Custom CSS', sprintf( esc_html__( 'Jetpack no longer supports Custom CSS. Read the WordPress.org documentation to learn how to apply custom styles to your site: %s', 'jetpack' ), 'https://wordpress.org/documentation/article/styles-overview/#applying-custom-css' ) );

Possibly adding the translatable string to a variable to then make it more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I was wondering why this was failing.

'WordPress Custom CSS',
sprintf(
// translators: %s is a link to the WordPress.org documentation.
Expand Down
Loading