Skip to content

Commit

Permalink
Holiday snow: do not display on p2 (#40519)
Browse files Browse the repository at this point in the history
* Holiday snow: do not display on p2

Follow-up to #40478

The snowstorm library we use to display falling snow is not compatible with p2s. Let's consequently not offer the option to turn on snow on p2s.

* changelog

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12239666390

Upstream-Ref: Automattic/jetpack@c6bc2c2
  • Loading branch information
jeherve authored and matticbot committed Dec 9, 2024
1 parent ebc103d commit 34c29fc
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 86 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This is an alpha version! The changes listed here are not final.
- Use wp_add_inline_script

### Fixed
- Holiday Snow: do not display on p2s.
- Load WPCOM sidebar notice async

## [6.0.0] - 2024-12-04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ public static function is_snow_season() {
return apply_filters( 'jetpack_is_holiday_snow_season', $is_snow_season );
}

/**
* Check if the site uses p2.
* p2 is currently not compatible with Holiday Snow.
* This covers both P2 and P2020 themes.
*
* @return bool
*/
private static function is_p2() {
return str_contains( get_stylesheet(), 'pub/p2' )
|| function_exists( '\WPForTeams\is_wpforteams_site' ) && is_wpforteams_site( get_current_blog_id() );
}

/**
* Check if the snow is enabled.
*
Expand All @@ -62,7 +74,7 @@ public static function is_snow_enabled() {
* @return void
*/
public static function init() {
if ( ! self::is_snow_season() ) {
if ( ! self::is_snow_season() || self::is_p2() ) {
return;
}

Expand Down
Loading

0 comments on commit 34c29fc

Please sign in to comment.