WC_Settings_Emails::get_custom_fonts()publicWC 1.0

Get custom fonts for emails.

Метод класса: WC_Settings_Emails{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Settings_Emails = new WC_Settings_Emails();
$WC_Settings_Emails->get_custom_fonts();

Код WC_Settings_Emails::get_custom_fonts() WC 9.7.1

public function get_custom_fonts() {
	$custom_fonts = array();
	if ( wc_current_theme_is_fse_theme() && class_exists( 'WP_Font_Face_Resolver' ) ) {
		$theme_fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json();
		if ( count( $theme_fonts ) > 0 ) {
			foreach ( $theme_fonts as $font ) {
				if ( ! empty( $font[0]['font-family'] ) ) {
					$custom_fonts[ $font[0]['font-family'] ] = $font[0]['font-family'];
				}
			}
		}
	}
	ksort( $custom_fonts );

	return $custom_fonts;
}