packages/kirki-framework/module-webfonts/src/Embed.php
private function use_local_files( $css ) {
		preg_match_all( '/https\:.*?\.woff/', $css, $matches );

		$matches = array_shift( $matches );

		foreach ( $matches as $match ) {
			if ( 0 === strpos( $match, 'https://fonts.gstatic.com' ) ) {
				$new_url = Helper::download_font_file( $match );
				if ( $new_url ) {
					$css = str_replace( $match, $new_url, $css );
				}
			}
		}
		return $css;
	}
private function use_local_files( $css ) {
		preg_match_all( '/https\:.*?\.woff/', $css, $matches );

		$matches = array_shift( $matches );

		foreach ( $matches as $match ) {
			if ( 0 === strpos( $match, 'https://fonts.gstatic.com' ) ) {
				$new_url = Helper::download_font_file( $match );
				if ( $new_url ) {
					$css = str_replace( $match, $new_url, $css );
				}
			}
		}
		return $css;
	}
private function use_local_files ( $ css ) { preg_match_all ( '/https\:.*?\.woff/' , $ css , $ matches ) ; $ matches = array_shift ( $ matches ) ; foreach ( $ matches as $ match ) { if ( 0 === strpos ( $ match , 'https://fonts.gstatic.com' ) ) { $ new_url = Helper :: download_font_file ( $ match ) ; if ( $ new_url ) { $ css = str_replace ( $ match , $ new_url , $ css ) ; } } } return $ css ; }
Downloads font-files locally and uses the local files instead of the ones from Google's servers.
This addresses any and all GDPR concerns, as well as firewalls that exist in some parts of the world.

@access private
@since 3.0.36
@param string $css The CSS with original URLs.
@return string     The CSS with local URLs.
Downloads font - files locally and uses the local files instead of the ones from Google s servers . This addresses any and all GDPR concerns as well as firewalls that exist in some parts of the world .