Astra_Fonts_Data::js( bool $skip_google_fonts = true )

Localize Fonts


Description


Parameters

$skip_google_fonts

(bool) (Optional) Whether to skip Google Fonts loading for initial load optimization.

Default value: true


Source

File: inc/customizer/class-astra-fonts-data.php

		public static function js() {

			$system = wp_json_encode( Astra_Font_Families::get_system_fonts() );
			$google = wp_json_encode( Astra_Font_Families::get_google_fonts() );
			$custom = wp_json_encode( Astra_Font_Families::get_custom_fonts() );
			if ( ! empty( $custom ) ) {
				return 'var AstFontFamilies = { system: ' . $system . ', custom: ' . $custom . ', google: ' . $google . ' };';
			} else {
				return 'var AstFontFamilies = { system: ' . $system . ', google: ' . $google . ' };';
			}
		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.