Automattic\WooCommerce\Internal\Admin\Onboarding

OnboardingFonts::install_fonts()public staticWC 1.0

Create Font Families and Font Faces.

Method of the class: OnboardingFonts{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = OnboardingFonts::install_fonts();

OnboardingFonts::install_fonts() code WC 9.3.3

public static function install_fonts() {
	$collections                   = \WP_Font_Library::get_instance()->get_font_collections();
	$google_fonts                  = $collections['google-fonts']->get_data();
	$font_collection               = $google_fonts['font_families'];
	$slug_font_families_to_install = array_keys( self::FONT_FAMILIES_TO_INSTALL );
	$installed_font_families       = self::install_font_families( $slug_font_families_to_install, $font_collection );

	if ( ! empty( $installed_font_families ) ) {
		$font_faces_from_collection = self::get_font_faces_data_from_font_collection( $slug_font_families_to_install, $font_collection );
		self::install_font_faces( $slug_font_families_to_install, $installed_font_families, $font_faces_from_collection );
	}

}