HEX
Server: Apache/2
System: Linux esx60.csv-networks.nl 4.18.0-553.44.1.el8_10.x86_64 #1 SMP Mon Mar 10 05:10:11 EDT 2025 x86_64
User: loft320 (1016)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/loft320/public_html/wp-content/themes/astra/inc/customizer/class-astra-fonts-data.php
<?php
/**
 * Helper class for font settings.
 *
 * @package     Astra
 * @link        https://wpastra.com/
 * @since       Astra 1.0.0
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Font info class for System and Google fonts.
 */
if ( ! class_exists( 'Astra_Fonts_Data' ) ) {

	/**
	 * Fonts Data
	 */
	final class Astra_Fonts_Data {
		/**
		 * Localize Fonts
		 *
		 * @param bool $skip_google_fonts Whether to skip Google Fonts loading for initial load optimization.
		 */
		public static function js( $skip_google_fonts = true ) {

			$system = wp_json_encode( Astra_Font_Families::get_system_fonts() );
			$custom = wp_json_encode( Astra_Font_Families::get_custom_fonts() );

			/** @psalm-suppress UndefinedVariable */
			if ( $skip_google_fonts ) {
				$custom = $custom ? $custom : '{}';
				/** @psalm-suppress RedundantConditionGivenDocblockType */
				if ( ! empty( $custom ) && '{}' !== $custom ) {
					return 'var AstFontFamilies = { system: ' . ( $system ?: '{}' ) . ', custom: ' . $custom . ', google: {}, googleLoaded: false };';
				}
				return 'var AstFontFamilies = { system: ' . ( $system ?: '{}' ) . ', google: {}, googleLoaded: false };';
			}

			$google = wp_json_encode( Astra_Font_Families::get_google_fonts() );
			$custom = $custom ? $custom : '{}';
			$google = $google ? $google : '{}';
			$system = $system ? $system : '{}';

			/** @psalm-suppress RedundantConditionGivenDocblockType */
			if ( ! empty( $custom ) && '{}' !== $custom ) {
				return 'var AstFontFamilies = { system: ' . $system . ', custom: ' . $custom . ', google: ' . $google . ', googleLoaded: true };';
			}

			return 'var AstFontFamilies = { system: ' . $system . ', google: ' . $google . ', googleLoaded: true };';
		}
	}

}