✏️ 正在编辑: class-astra-fonts-data.php
路径:
/home/eblama1/mintawon.farm/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 };'; } } }
💾 保存文件
← 返回文件管理器