$value ) { if ( ! empty( $value ) && strpos( $key, 'gutsliders_' ) === 0 && strpos( $key, 'FontFamily' ) !== false ) { self::$all_fonts[] = $value; } } } } /** * Load fonts * return void */ public function fonts_loader() { if ( is_array( self::$all_fonts ) && count( self::$all_fonts ) > 0 ) { $fonts = array_filter( array_unique( self::$all_fonts ) ); if ( ! empty( $fonts ) ) { $system = array( 'Arial', 'Tahoma', 'Verdana', 'Helvetica', 'Times New Roman', 'Trebuchet MS', 'Georgia', ); $gfonts = ''; $gfonts_attr = ':100,200,300,400,500,600,700,800,900'; foreach ($fonts as $font) { if ( ! in_array( $font, $system, true) && ! empty( $font ) ) { $gfonts .= str_replace( ' ', '+', trim( $font ) ) . $gfonts_attr . '|'; } } if ( ! empty( $gfonts ) ) { $query_args = [ 'family' => $gfonts ]; wp_register_style( 'gutsliders-fonts', add_query_arg( $query_args, '//fonts.googleapis.com/css' ), [], GUTSLIDER_VERSION, 'all' ); wp_enqueue_style( 'gutsliders-fonts', false, [], GUTSLIDER_VERSION, 'all' ); } // Reset. $gfonts = ''; } } } } } new GutSlider_Load_Fonts(); // Initialize the class