Skip to content

Commit c6bc2c2

Browse files
authored
Holiday snow: do not display on p2 (#40519)
* 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
1 parent 07ddbe7 commit c6bc2c2

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Holiday Snow: do not display on p2s.

projects/packages/jetpack-mu-wpcom/src/features/holiday-snow/class-holiday-snow.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ public static function is_snow_season() {
4747
return apply_filters( 'jetpack_is_holiday_snow_season', $is_snow_season );
4848
}
4949

50+
/**
51+
* Check if the site uses p2.
52+
* p2 is currently not compatible with Holiday Snow.
53+
* This covers both P2 and P2020 themes.
54+
*
55+
* @return bool
56+
*/
57+
private static function is_p2() {
58+
return str_contains( get_stylesheet(), 'pub/p2' )
59+
|| function_exists( '\WPForTeams\is_wpforteams_site' ) && is_wpforteams_site( get_current_blog_id() );
60+
}
61+
5062
/**
5163
* Check if the snow is enabled.
5264
*
@@ -62,7 +74,7 @@ public static function is_snow_enabled() {
6274
* @return void
6375
*/
6476
public static function init() {
65-
if ( ! self::is_snow_season() ) {
77+
if ( ! self::is_snow_season() || self::is_p2() ) {
6678
return;
6779
}
6880

0 commit comments

Comments
 (0)