ArrayHQ / atomic-blocks-theme

34 stars 14 forks source link

PHP notice when using Disable Google Fonts plugin #30

Closed mindctrl closed 5 years ago

mindctrl commented 5 years ago

PHP Notice: Undefined variable: font_families in /app/public/wp-content/themes/atomic-blocks-theme/functions.php on line 201

https://github.com/ArrayHQ/atomic-blocks-theme/blob/3627a4bc20055511514567e2550815ac9cab42ec/functions.php#L201

The logic in atomic_blocks_fonts_url() assumes $font_families will be defined.

Also, the function always overwrites $fonts_url even when the fonts are disabled.

https://github.com/ArrayHQ/atomic-blocks-theme/blob/3627a4bc20055511514567e2550815ac9cab42ec/functions.php#L205

It should only do that if they fonts haven't been disabled, otherwise it should return the empty string defined at the top of the function.