diff --git a/projects/plugins/jetpack/changelog/fix-subscriptions-inline-styles-path b/projects/plugins/jetpack/changelog/fix-subscriptions-inline-styles-path new file mode 100644 index 000000000000..0e3f5d3cd9c4 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-subscriptions-inline-styles-path @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Subscriptions: fix `wp_maybe_inline_styles` notice for the `jetpack-subscriptions` stylesheet by registering a filesystem path instead of a URL. diff --git a/projects/plugins/jetpack/modules/subscriptions/views.php b/projects/plugins/jetpack/modules/subscriptions/views.php index f5b35e9ac42b..6a872e7c4dec 100644 --- a/projects/plugins/jetpack/modules/subscriptions/views.php +++ b/projects/plugins/jetpack/modules/subscriptions/views.php @@ -114,7 +114,15 @@ public function enqueue_style() { array(), JETPACK__VERSION ); - wp_style_add_data( 'jetpack-subscriptions', 'path', $path ); + + // `wp_maybe_inline_styles()` requires a filesystem path, not a URL. + $style_path = JETPACK__PLUGIN_DIR . ( + /** This filter is documented in projects/plugins/jetpack/load-jetpack.php */ + apply_filters( 'jetpack_should_use_minified_assets', true ) + ? '_inc/build/subscriptions/subscriptions.min.css' + : 'modules/subscriptions/subscriptions.css' + ); + wp_style_add_data( 'jetpack-subscriptions', 'path', $style_path ); } /**