ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
923 stars 219 forks source link

Trying to access array offset on value of type null #4258

Open MKtwentyone opened 1 year ago

MKtwentyone commented 1 year ago

Hello, there is the following code on our website: Warning: Trying to access array offset on value of type null in /home/.sites/352/site4814742/web/wp-content/plugins/unyson/framework/includes/option-types/typography-v2/class-fw-option-type-typography-v2.php on line 148

What can we do? This our domain: https://www.mofive.marketing

oscarleonz commented 1 year ago

I had the same problem yesterday. The plugin depends on the unyson.io website itself which was not renewed and was discontinued. Today it was apparently renewed but the problem continued on my website. The solution was to restore the website through a backup you have from days gone by. Greetings.

Tom2710 commented 1 year ago

I have the same problem on my website I would to resolve this please

corzel commented 1 year ago

Hi!, I removed the warning by adding the following code before the foreach on line 147, don't forget to close the if, line 153.

145 public function get_google_font( $font ) { 146 $fonts = $this->get_fonts(); 147 if (empty($fonts) === false && empty($g_font) === false) { 148 foreach ((array) $fonts['google']['items'] as $g_font ) { 149 if ( $font === $g_font['family'] ) { 150 return $g_font; 151 } 152 } 153 } 154 return false; 155 }