ソースを参照

Adding static keyword to avoid error in PHP 8 (#5082)

Declaring class properties or methods as static makes them accessible without needing an instantiation of the class.
Matias Benedetto 3 年 前
コミット
6051e0f592
1 ファイル変更3 行追加3 行削除
  1. 3 3
      blockbase/inc/customizer/wp-customize-color-palettes.php

+ 3 - 3
blockbase/inc/customizer/wp-customize-color-palettes.php

@@ -38,7 +38,7 @@ class GlobalStylesColorPalettes {
 				$custom_palette_setting = array();
 				foreach ( $custom_palette['colors'] as $color_slug => $color ) {
 					//the alternative palettes need to have the same color mapping as the default one
-					if(isset($default_palette_setting[$color_slug])){
+					if ( isset( $default_palette_setting[ $color_slug ] ) ) {
 						$custom_palette_setting[ $color_slug ] = $color;
 					}
 				}
@@ -86,8 +86,8 @@ class GlobalStylesColorPalettes {
 		);
 	}
 
-	function sanitize_color_palette( $palette ) {
-		return sanitize_title($palette);
+	static function sanitize_color_palette( $palette ) {
+		return sanitize_title( $palette );
 	}
 }