| @@ -13,9 +13,8 @@ | ||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | public function enqueue_frontend_block_fonts() { |
| 16 | 16 | |
| 17 | - | |
| 18 | 17 | |
| 19 | 18 | if ( ! apply_filters( 'blockspare_enqueue_fonts', true ) ) { |
| 20 | 19 | return; |
| 21 | 20 | } |
| @@ -41,10 +40,9 @@ | ||
| 41 | 40 | $this->enqueue_google_fonts( $google_fonts ); |
| 42 | 41 | } |
| 43 | 42 | |
| 44 | 43 | public function is_web_font( $font_name ) { |
| 45 | - | |
| 46 | - return ! in_array( $font_name , [ 'Arial', 'Times New Roman', 'Helvetica', 'Georgia' ] ); | |
| 44 | + return ! in_array( strtolower( $font_name ), [ 'serif', 'sans-serif', 'monospace', 'serif-alt' ] ); | |
| 47 | 45 | } |
| 48 | 46 | |
| 49 | 47 | public function is_blockspare_block( $block_name ) { |
| 50 | 48 | return strpos( $block_name, 'blockspare/' ) === 0; |
| @@ -50,8 +48,9 @@ | ||
| 50 | 48 | return strpos( $block_name, 'blockspare/' ) === 0; |
| 51 | 49 | } |
| 52 | 50 | |
| 53 | 51 | public function gather_google_fonts( $blocks ) { |
| 52 | + | |
| 54 | 53 | $google_fonts = array(); |
| 55 | 54 | foreach ( $blocks as $block ) { |
| 56 | 55 | |
| 57 | 56 | // Gather all "fontFamily" attribute values |