x_kirki_fonts_request_headers( $args, $url ) { if ( false === strpos( $url, 'https://fonts.googleapis.com/css' ) ) { return $args; } if ( isset( $args['user-agent'] ) && $args['user-agent'] == 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8' ) { $args['user-agent'] = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0'; } return $args; } add_filter( 'http_request_args', 'martfury_fix_kirki_fonts_request_headers', 10, 2 ); /** * Fix incorrect fonts files downloaded from Google. * Delete the Kirki's transients to force downloading font files again. * * @return void */ function martfury_fix_kirki_fonts() { delete_transient( 'kirki_remote_url_contents' ); } add_action( 'after_switch_theme', 'martfury_fix_kirki_fonts' ); add_action( 'wp_ajax_kirki_clear_font_cache', 'martfury_fix_kirki_fonts' ); }