....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 104.21.3.15  /  Your IP : 104.23.197.86
Web Server : Apache
System : Linux host6.northwind.al 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : elettreviso ( 1011)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/elettreviso/public_html/wp-content/themes/Total/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/elettreviso/public_html/wp-content/themes/Total/inc/typography.php
<?php

namespace TotalTheme;

use TotalTheme\Customizer\Controls\Top_Right_Bottom_Left as Control_Top_Right_Bottom_Left;
use TotalTheme\Customizer\Controls\Length_Unit as Control_Length_Unit;

\defined( 'ABSPATH' ) || exit;

/**
 * Adds all Typography options to the Customizer and outputs the custom CSS for them.
 */
final class Typography {

	/**
	 * Holds an array of supported fonts.
	 */
	private $supported_fonts = null;

	/**
	 * Instance.
	 */
	private static $instance = null;

	/**
	 * Create or retrieve the instance of our class.
	 */
	public static function instance() {
		if ( null === static::$instance ) {
			static::$instance = new self();
		}

		return static::$instance;
	}

	/**
	 * Main constructor.
	 */
	private function __construct() {
		if ( ! \get_theme_mod( 'typography_enable', true ) ) {
			return;
		}

		// Register customizer settings.
		if ( \wpex_has_customizer_panel( 'typography' ) ) {
			\add_action( 'customize_register',[ $this, 'register' ], 40 );
		}

		// Front-end actions.
		if ( \wpex_is_request( 'frontend' ) ) {

			// Enqueue Google Fonts.
			if ( \wpex_has_google_services_support() ) {
				if ( get_theme_mod( 'google_fonts_in_footer' ) ) {
					\add_action( 'wp_footer', [ $this, 'frontend_enqueue_google_fonts' ] );
				} else {
					\add_action( 'wp_enqueue_scripts', [ $this, 'frontend_enqueue_google_fonts' ] );
				}
			}

		}

		// CSS output for typography settings.
		if ( is_customize_preview() && \wpex_has_customizer_panel( 'typography' ) ) {
			\add_action( 'wp_enqueue_scripts', [ $this, 'customize_enqueue_registered_fonts' ] );
			\add_action( 'customize_preview_init', [ $this, 'customize_preview_js' ] );
			\add_action( 'customize_controls_enqueue_scripts', [ $this, 'customize_controls_js' ] );
			\add_action( 'wp_head', [ $this, 'customize_css' ], 999 );
		} else {
			\add_filter( 'wpex_head_css', [ $this, 'frontend_css' ], 99 );
		}

	}

	/**
	 * Array of Typography settings to add to the customizer.
	 */
	public function get_settings(): array {
		$header_is_custom = \totaltheme_call_static( 'Header\Core', 'is_custom' );
		$footer_is_custom = \totaltheme_call_static( 'Footer\Core', 'is_custom' );

		$settings = [];

		$settings['body'] = [
			'label'  => \esc_html__( 'Body', 'total' ),
			'target' => 'body',
		];

		if ( ! $header_is_custom ) {
			$settings['logo'] = [
				'label' => \esc_html__( 'Logo', 'total' ),
				'target' => '#site-logo .site-logo-text',
				'exclude' => [ 'color' ],
				'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::hasnt_image_logo',
			];
		}

		$settings['button'] = [
			'label' => \esc_html__( 'Buttons', 'total' ),
			'target' => ':root',
			'exclude' => [ 'color', 'margin' ],
			'css_vars' => [
				'text-transform' => '--wpex-btn-text-transform',
				'letter-spacing' => '--wpex-btn-letter-spacing',
				'font-family' => '--wpex-btn-font-family',
				'font-style' => '--wpex-btn-font-style',
				'font-weight' => '--wpex-btn-font-weight',
				'line-height' => '--wpex-btn-line-height',
				'font-size' => '--wpex-btn-font-size',
			],
		];

		$settings['toggle_bar'] = [
			'label' => \esc_html__( 'Toggle Bar', 'total' ),
			'target' => '#toggle-bar-wrap',
			'exclude' => [ 'color' ],
			'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_toggle_bar',
			'condition' => 'wpex_has_togglebar',
		];

		// @todo this be renamed to topbar?
		$settings['top_menu'] = [
			'label' => \esc_html__( 'Top Bar', 'total' ),
			'target' => '#top-bar-content',
			'exclude' => [ 'color' ],
			'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_top_bar',
			'condition' => 'TotalTheme\Topbar\Core::is_enabled',
		];

		if ( ! $header_is_custom ) {
			$settings['header_aside'] = [
				'label' => \esc_html__( 'Header Aside', 'total' ),
				'target' => '.header-aside-content',
			];

			$settings['menu'] = [
				'label' => \esc_html__( 'Main Menu', 'total' ),
				'target' => '.main-navigation-ul .link-inner', // @todo Should we add : #current-shop-items-dropdown, #searchform-dropdown input[type="search"] ??
				'exclude' => [ 'color', 'line-height' ], // Can't include color causes issues with menu styling settings
				'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::can_menu_typography',
				'condition' => 'wpex_hasnt_dev_style_header',
			];

			$settings['menu_dropdown'] = [
				'label' => \esc_html__( 'Main Menu: Dropdowns', 'total' ),
				'target' => '.main-navigation-ul .sub-menu .link-inner',
				'exclude' => [ 'color' ],
				'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::can_menu_typography',
				'condition' => 'wpex_hasnt_dev_style_header',
			];

			$settings['mobile_menu'] = [
				'label' => \esc_html__( 'Mobile Menu', 'total' ),
				'target' => '.wpex-mobile-menu, #sidr-main',
				'exclude' => [ 'color' ],
			];
		}

		$settings['page_title'] = [
			'label' => \esc_html__( 'Page Header Title', 'total' ),
			'description' => \esc_html__( 'Important: These settings will only affect the Globally set page header style in order to prevent conflicts when using a custom style on a per-page basis.', 'total' ),
			'target' => '.page-header .page-header-title',
			'exclude' => [ 'color' ],
			'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_page_header',
			'condition' => 'TotalTheme\Page\Header::is_enabled',
		];

		$settings['page_subheading'] = [
			'label' => \esc_html__( 'Page Title Subheading', 'total' ),
			'target' => '.page-header .page-subheading',
			'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_page_header',
			'condition' => 'TotalTheme\Page\Header::is_enabled',
		];

		$settings['blog_entry_title'] = [
			'label' => \esc_html__( 'Blog Entry Title', 'total' ),
			// @todo can we optimize this?
			'target' => '.blog-entry-title.entry-title, .blog-entry-title.entry-title a, .blog-entry-title.entry-title a:hover',
		];

		$settings['blog_entry_meta'] = [
			'label' => \esc_html__( 'Blog Entry Meta', 'total' ),
			'target' => '.blog-entry .meta',
		];

		$settings['blog_entry_content'] = [
			'label' => \esc_html__( 'Blog Entry Excerpt', 'total' ),
			'target' => '.blog-entry-excerpt',
		];

		$settings['blog_post_title'] = [
			'label' => \esc_html__( 'Blog Post Title', 'total' ),
			'target' => 'body.single-post .single-post-title',
		];

		$settings['blog_post_meta'] = [
			'label' => \esc_html__( 'Blog Post Meta', 'total' ),
			'target' => '.single-post .meta',
		];

		$settings['breadcrumbs'] = [
			'label' => \esc_html__( 'Breadcrumbs', 'total' ),
			'target' => '.site-breadcrumbs',
			'exclude' => [ 'color', 'line-height' ],
			'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_breadcrumbs',
			'condition' => 'wpex_has_breadcrumbs',
		];

		$settings['blockquote'] = [
			'label' => \esc_html__( 'Blockquote', 'total' ),
			'target' => 'blockquote',
			'exclude' => [ 'color' ],
		];

		$settings['sidebar'] = [
			'label' => \esc_html__( 'Sidebar', 'total' ),
			'target' => '#sidebar',
			'exclude' => [ 'color' ],
			'condition' => 'wpex_has_sidebar',
		];

		$settings['sidebar_widget_title'] = [
			'label' => \esc_html__( 'Sidebar Widget Heading', 'total' ),
			'target' => '.sidebar-box .widget-title',
			'margin' => true,
			'exclude' => [ 'color' ],
		];

		$settings['headings'] = [
			'label' => \esc_html__( 'Headings', 'total' ),
			'target' => ':root', // important so it doesn't break the wpex-dark-surface class.
			'exclude' => [ 'font-size' ],
			'css_vars' => [
				'color' => '--wpex-heading-color',
				'text-transform' => '--wpex-heading-text-transform',
				'letter-spacing' => '--wpex-heading-letter-spacing',
				'font-family' => '--wpex-heading-font-family',
				'font-style' => '--wpex-heading-font-style',
				'font-weight' => '--wpex-heading-font-weight',
				'line-height' => '--wpex-heading-line-height',
			],
		];

		$settings['theme_heading'] = [
			'label' => \esc_html__( 'Theme Heading', 'total' ),
			'target' => '.theme-heading',
			'margin' => true,
		];

		if ( WPEX_VC_ACTIVE ) {
			$settings['vcex_heading'] = [
				'label'  => \esc_html__( 'Heading Element', 'total' ),
				// @important - we must target the .vcex-heading.wpex-heading element to work with the Customizer's
				// Custom Heading Typography setting but still add the default styles to the element.
				'target' => '.vcex-heading',
				'margin' => \totaltheme_has_classic_styles(),
			];
		}

		$settings['entry_h1'] = [
			'label' => \esc_html__( 'H1', 'total' ),
			'target' => 'h1,.wpex-h1',
			'margin' => true,
			'description' => \esc_html__( 'Will target headings in your post content.', 'total' ),
			// @important headings can't target CSS vars.
		];

		$settings['entry_h2'] = [
			'label' => 'H2',
			'target' => 'h2,.wpex-h2',
			'margin' => true,
			'description' => \esc_html__( 'Will target headings in your post content.', 'total' ),
			// @important headings can't target CSS vars.
		];

		$settings['entry_h3'] = [
			'label' => 'H3',
			'target' => 'h3,.wpex-h3',
			'margin' => true,
			'description' => \esc_html__( 'Will target headings in your post content.', 'total' ),
			// @important headings can't target CSS vars.
		];

		$settings['entry_h4'] = [
			'label' => 'H4',
			'target' => 'h4,.wpex-h4',
			'margin' => true,
			'description' => \esc_html__( 'Will target headings in your post content.', 'total' ),
			// @important headings can't target CSS vars.
		];

		$settings['post_content'] = [
			'label' => \esc_html__( 'Post Content', 'total' ),
			'target' => '.single-blog-content, .vcex-post-content-c, .wpb_text_column, body.no-composer .single-content, .woocommerce-Tabs-panel--description',
		];

		if ( ! $footer_is_custom || get_theme_mod( 'footer_builder_footer_widgets' ) ) {
			$settings['footer_widgets'] = [
				'label' => \esc_html__( 'Footer Widgets', 'total' ),
				'target' => '#footer-widgets',
				'exclude' => [ 'color' ],
				'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_footer_widgets',
				'condition' => 'TotalTheme\Footer\Widgets::is_enabled',
			];

			$settings['footer_widget_title'] = [
				'label' => \esc_html__( 'Footer Widget Heading', 'total' ),
				'target' => '.footer-widget .widget-title',
				'exclude' => [ 'color' ],
				'margin' => true,
				'active_callback' => 'TotalTheme\Customizer\Active_Callbacks::has_footer_widgets',
				'condition' => 'TotalTheme\Footer\Widgets::is_enabled',
			];
		}

		$settings['callout'] = [
			'label' => \esc_html__( 'Footer Callout', 'total' ),
			'target' => '.footer-callout-content',
			'exclude' => [ 'color' ],
			'condition' => 'TotalTheme\Footer\Callout::is_enabled',
		];

		if ( ! $footer_is_custom || get_theme_mod( 'footer_builder_footer_bottom' ) ) {
			$settings['copyright'] = [
				'label' => \esc_html__( 'Footer Bottom Text', 'total' ),
				'target' => '#copyright',
				'exclude' => [ 'color' ],
				'condition' => 'TotalTheme\Footer\Bottom\Core::is_enabled',
			];
			$settings['footer_menu'] = [
				'label' => \esc_html__( 'Footer Bottom Menu', 'total' ),
				'target' => '#footer-bottom-menu',
				'exclude' => [ 'color' ],
				'condition' => 'TotalTheme\Footer\Bottom\Core::is_enabled',
			];
		}

		return (array) \apply_filters( 'wpex_typography_settings', $settings );
	}

	/**
	 * Loads scripts for live previews.
	 */
	public function customize_preview_js(): void {
		\wp_enqueue_script(
			'totaltheme-customize-typography',
			\totaltheme_get_js_file( 'customize/typography' ),
			[ 'customize-preview' ],
			\WPEX_THEME_VERSION,
			true
		);

		\wp_localize_script(
			'totaltheme-customize-typography',
			'totaltheme_customize_typography_vars',
			[
				'stdFonts'          => \wpex_standard_fonts(),
				'userFonts'         => \array_keys( \wpex_get_registered_fonts() ),
				'customFonts'       => \wpex_add_custom_fonts(),
				'googleFontsUrl'    => \wpex_get_google_fonts_url(),
				'googleFontsSuffix' => '100i,200i,300i,400i,500i,600i,700i,800i,100,200,300,400,500,600,700,800',
				'sytemUIFontStack'  => \wpex_get_system_ui_font_stack(),
				'settings'          => $this->get_settings(),
				'properties'        => [
					'font-family',
					'font-weight',
					'font-style',
					'font-size',
					'color',
					'line-height',
					'letter-spacing',
					'text-transform',
					'margin',
				],
			]
		);
	}

	/**
	 * Loads scripts for custom controls.
	 */
	public function customize_controls_js(): void {
		\wp_enqueue_script(
			'totaltheme-customize-typography-quicklinks',
			\totaltheme_get_js_file( 'customize/typography-quick-links' ),
			[ 'customize-controls' ],
			\WPEX_THEME_VERSION
		);
		\wp_localize_script(
			'totaltheme-customize-typography-quicklinks',
			'totaltheme_customize_typography_quicklinks_vars',
			[
				'linkText'     => \esc_html__( 'edit font', 'total' ),
				'backLinkText' => \esc_html__( 'back to setting', 'total' ),
			]
		);
	}

	/**
	 * Register typography options to the Customizer.
	 */
	public function register( $wp_customize ) {
		if ( ! \class_exists( '\TotalTheme\Customizer', false ) ) {
			return;
		}

		// Get Settings.
		$settings = $this->get_settings();

		// Return if settings are empty. This check is needed due to the filter added above.
		if ( empty( $settings ) ) {
			return;
		}

		// Add General Panel.
		$wp_customize->add_panel( 'wpex_typography', [
			'priority' => 144,
			'capability' => 'edit_theme_options',
			'title' => \esc_html__( 'Typography', 'total' ),
		] );

		// Add General Tab with font smoothing.
		$wp_customize->add_section( 'wpex_typography_general' , [
			'title' => \esc_html__( 'General', 'total' ),
			'priority' => 1,
			'panel' => 'wpex_typography',
		] );

		// Font Smoothing.
		$wp_customize->add_setting( 'enable_font_smoothing', [
			'type' => 'theme_mod',
			'transport' => 'postMessage',
			'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::checkbox',
		] );
		$wp_customize->add_control( new Customizer\Controls\Toggle( $wp_customize, 'enable_font_smoothing', [
			'label' => \esc_html__( 'Font Smoothing', 'total' ),
			'section' => 'wpex_typography_general',
			'settings' => 'enable_font_smoothing',
			'type' => 'totaltheme_toggle',
			'description' => \esc_html__( 'Enable font-smoothing site wide. This makes fonts look a little "skinner". ', 'total' ),
		] ) );

		// Load fonts in footer.
		$wp_customize->add_setting( 'google_fonts_in_footer', [
			'type' => 'theme_mod',
			'transport' => 'postMessage',
			'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::checkbox',
		] );

		$wp_customize->add_control( new Customizer\Controls\Toggle( $wp_customize, 'google_fonts_in_footer', [
			'label' => \esc_html__( 'Load Fonts Last', 'total' ),
			'section' => 'wpex_typography_general',
			'settings' => 'google_fonts_in_footer',
			'type' => 'totaltheme_toggle',
			'description' => \esc_html__( 'Enable to load fonts after your body tag. This can help with render blocking scripts but also means your text will swap fonts so it may not render nicely.', 'total' ),
		] ) );

		// Bold Font Weight.
		$wp_customize->add_setting( 'bold_font_weight', [
			'type' => 'theme_mod',
			'sanitize_callback' => 'sanitize_text_field',
		] );

		$wp_customize->add_control( new \WP_Customize_Control( $wp_customize, 'bold_font_weight', [
			'label' => \esc_html__( 'Bold Font Weight', 'total' ),
			'section' => 'wpex_typography_general',
			'settings' => 'bold_font_weight',
			'type' => 'select',
			'choices' => $this->choices_font_weights(),
			'description' => \esc_html__( 'Controls the defaul font weight for bold elements in the theme.', 'total' ),
		] ) );

		// Google Font settings.
		if ( wpex_has_google_services_support() ) {

			// Load custom font 1.
			$wp_customize->add_setting( 'load_custom_google_font_1', [
				'type' => 'theme_mod',
				'sanitize_callback' => 'sanitize_text_field',
			] );

			$wp_customize->add_control( new Customizer\Controls\Font_Family( $wp_customize, 'load_custom_google_font_1', [
				'label' => \esc_html__( 'Load Custom Font', 'total' ),
				'section' => 'wpex_typography_general',
				'settings' => 'load_custom_google_font_1',
				'type' => 'totaltheme_font_family',
				'description' => \esc_html__( 'Allows you to load a custom font site wide for use with custom CSS. ', 'total' ),
			] ) );

			// Google font display option.
			$wp_customize->add_setting( 'google_font_display', [
				'type' => 'theme_mod',
				'transport' => 'postMessage',
				'default' => 'swap',
				'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::select',
			] );

			$wp_customize->add_control( new \WP_Customize_Control( $wp_customize, 'google_font_display', [
				'label' => \esc_html__( 'Google Font Display Type', 'total' ),
				'section' => 'wpex_typography_general',
				'settings' => 'google_font_display',
				'type' => 'select',
				'choices' => [
					'' => \esc_html__( 'None', 'total' ),
					'auto' => 'auto',
					'block' => 'block',
					'swap' => 'swap',
					'fallback' => 'fallback',
					'optional' => 'optional',
				],
				'description' => '<a href="https://developer.chrome.com/blog/font-display/#which-font-display-is-right-for-you" target="_blank" rel="noopener noreferrer">' . \esc_html__( 'Learn More', 'total' ) . ' &#8599;</a>'
			] ) );

			// Select subsets.
			$wp_customize->add_setting( 'google_font_subsets', [
				'type' => 'theme_mod',
				'default' => 'latin',
				'sanitize_callback' => 'sanitize_text_field',
			] );

			$wp_customize->add_control( new Customizer\Controls\Multi_Select( $wp_customize, 'google_font_subsets', [
				'label'    => \esc_html__( 'Font Subsets', 'total' ),
				'section'  => 'wpex_typography_general',
				'settings' => 'google_font_subsets',
				'choices'  => [
					'latin'        => 'latin',
					'latin-ext'    => 'latin-ext',
					'cyrillic'     => 'cyrillic',
					'cyrillic-ext' => 'cyrillic-ext',
					'greek'        => 'greek',
					'greek-ext'    => 'greek-ext',
					'vietnamese'   => 'vietnamese',
				],
			] ) );
		}

		// Loop through settings.
		foreach ( $settings as $element => $array ) {

			$label = $array['label'] ?? null;

			if ( ! $label ) {
				continue; // label is required.
			}

			$active_callback = $array['active_callback'] ?? null;
			$description     = $array['description'] ?? '';
			$transport       = $array['transport'] ?? 'postMessage';

			// Get attributes.
			if ( ! empty ( $array['attributes'] ) ) {
				$attributes = $array['attributes'];
			} else {
				$attributes = [
					'font-family',
					'font-weight',
					'font-style',
					'text-transform',
					'font-size',
					'line-height',
					'letter-spacing',
					'color',
				];
			}

			// Margin must be enabled seperately.
			if ( isset( $array['margin'] ) && true === $array['margin'] ) {
				$attributes[] = 'margin';
			}

			// Set keys equal to vals.
			$attributes = \array_combine( $attributes, $attributes );

			// Exclude attributes for specific options.
			if ( ! empty( $array['exclude'] ) && is_array( $array['exclude'] ) ) {
				foreach ( $array['exclude'] as $key => $val ) {
					unset( $attributes[ $val ] );
				}
			}

			// Define Section.
			$wp_customize->add_section( "wpex_typography_{$element}" , [
				'title'       => $label,
				'panel'       => 'wpex_typography',
				'description' => $description,
			] );

			// Font Family.
			if ( \in_array( 'font-family', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[font-family]", [
					'type'              => 'theme_mod',
					'transport'         => $transport,
					'sanitize_callback' => 'sanitize_text_field',
				] );

				$control_args = [
						'type'            => 'totaltheme_font_family',
						'label'           => \esc_html__( 'Font Family', 'total' ),
						'section'         => "wpex_typography_{$element}",
						'settings'        =>  "{$element}_typography[font-family]",
						'active_callback' => $active_callback,
				];

				if ( \class_exists( 'WPEX_Font_Manager', false ) ) {
					$control_args['description'] = sprintf( \esc_html__( 'You can use the %sFont Manager%s to register additional Google, Adobe or custom fonts.', 'total' ), '<a href="' . esc_url( admin_url( 'edit.php?post_type=wpex_font' ) ) . '" target="_blank" rel="noopener noreferrer">', ' &#8599;</a>' );
				}

				$wp_customize->add_control( new Customizer\Controls\Font_Family(
					$wp_customize,
					"{$element}_typography[font-family]",
					$control_args
				) );
			}

			// Font Weight.
			if ( \in_array( 'font-weight', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[font-weight]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::select',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( "{$element}_typography[font-weight]", [
					'label'           => \esc_html__( 'Font Weight', 'total' ),
					'section'         => "wpex_typography_{$element}",
					'settings'        => "{$element}_typography[font-weight]",
					'type'            => 'select',
					'active_callback' => $active_callback,
					'choices'         => $this->choices_font_weights(),
					'description'     => \esc_html__( 'Note: Not all Fonts support every font weight style. ', 'total' ),
				] );
			}

			// Font Style.
			if ( \in_array( 'font-style', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[font-style]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::select',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( "{$element}_typography[font-style]", [
					'label'           => \esc_html__( 'Font Style', 'total' ),
					'section'         => "wpex_typography_{$element}",
					'settings'        => "{$element}_typography[font-style]",
					'type'            => 'select',
					'active_callback' => $active_callback,
					'choices'         => $this->choices_font_style(),
				] );
			}

			// Text-Transform.
			if ( \in_array( 'text-transform', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[text-transform]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::select',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( "{$element}_typography[text-transform]", [
					'label'           => \esc_html__( 'Text Transform', 'total' ),
					'section'         => "wpex_typography_{$element}",
					'settings'        => "{$element}_typography[text-transform]",
					'type'            => 'select',
					'active_callback' => $active_callback,
					'choices'         => $this->choices_text_transform(),
				] );
			}

			// Font Size.
			if ( \in_array( 'font-size', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[font-size]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::font_size',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( new Customizer\Controls\Font_Size( $wp_customize, "{$element}_typography[font-size]", [
					'label'           => \esc_html__( 'Font Size', 'total' ),
					'section'         => "wpex_typography_{$element}",
					'settings'        => "{$element}_typography[font-size]",
					'type'            => 'totaltheme_font_size',
					'active_callback' => $active_callback,
				] ) );
			}

			// Font Color.
			if ( \in_array( 'color', $attributes ) ) {
				switch ( $element ) {
					case 'body':
						$color_description = \sprintf(
							\esc_html__( 'By default the body color uses the "Text 2" color defined in your color scheme where we recommend modifying it for consistency. (%sedit color scheme%s)', 'total' ), '<span class="totaltheme-customize-focus-link" data-wpex-section="wpex_color_scheme" data-wpex-control="body_typography_color">',
							'</span>'
						);
						break;
					case 'headings':
						$color_description = \sprintf(
							\esc_html__( 'By default the headings color uses the "Text 1" color defined in your color scheme where we recommend modifying it for consistency. (%sedit color scheme%s)', 'total' ), '<span class="totaltheme-customize-focus-link" data-wpex-section="wpex_color_scheme" data-wpex-control="headings_typography_color">',
							'</span>'
						);
						break;
					default:
					$color_description = '';
						break;
				}
				$wp_customize->add_setting( "{$element}_typography[color]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'TotalTheme\Customizer\Sanitize_Callbacks::color',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( new Customizer\Controls\Color( $wp_customize, "{$element}_typography_color", [
					'label'           => \esc_html__( 'Color', 'total' ),
					'section'         => "wpex_typography_{$element}",
					'settings'        => "{$element}_typography[color]",
					'active_callback' => $active_callback,
					'description'     => $color_description,
				] ) );
			}

			// Line Height.
			if ( \in_array( 'line-height', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[line-height]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( new Control_Length_Unit( $wp_customize, "{$element}_typography[line-height]", [
						'label'           => \esc_html__( 'Line Height', 'total' ),
						'section'         => "wpex_typography_{$element}",
						'settings'        => "{$element}_typography[line-height]",
						'type'            => 'totaltheme_length_unit',
						'default_unit'    => 'int',
						'units'           => [ 'int', 'px', 'em', 'rem', '%', 'vmin', 'vmax', 'var', 'func' ],
						'active_callback' => $active_callback,
				] ) );
			}

			// Letter Spacing.
			if ( \in_array( 'letter-spacing', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[letter-spacing]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( new Control_Length_Unit( $wp_customize, "{$element}_typography_letter_spacing", [
					'label'           => \esc_html__( 'Letter Spacing', 'total' ),
					'section'         => "wpex_typography_{$element}",
					'settings'        => "{$element}_typography[letter-spacing]",
					'type'            => 'totaltheme_length_unit',
					'units'           => [ 'px', 'em', 'rem', 'vmin', 'vmax', 'var', 'func' ],
					'active_callback' => $active_callback,
				] ) );
			}

			// Margin.
			if ( \in_array( 'margin', $attributes ) ) {
				$wp_customize->add_setting( "{$element}_typography[margin]", [
					'type'              => 'theme_mod',
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $transport,
				] );
				$wp_customize->add_control( new Control_Top_Right_Bottom_Left( $wp_customize, "{$element}_typography[margin]",
					[
						'label'           => \esc_html__( 'Margin', 'total' ),
						'section'         => "wpex_typography_{$element}",
						'settings'        =>  "{$element}_typography[margin]",
						'type'            => 'totaltheme_trbl',
						'active_callback' => $active_callback,
				] ) );
			}

		}

	}

	/**
	 * Loop through settings.
	 *
	 * @todo combine CSS targeting the same selector (such as :root).
	 */
	public function loop( $return = 'css' ) {
		$end_css              = '';
		$css                  = '';
		$tablet_landscape_css = '';
		$tablet_portrait_css  = '';
		$phone_landscape_css  = '';
		$phone_portrait_css   = '';
		$preview_styles       = [];

		// Loop through settings that need typography styling applied to them.
		foreach ( $this->get_settings() as $element => $array ) {
			if ( empty( $array['target'] ) ) {
				continue;
			}

			$get_mod  = $this->get_setting_val( $element );

			if ( ! $get_mod ) {
				continue;
			}

			// Check conditional when running CSS loop.
			// Prevents CSS from being added to the page if not needed.
			if ( 'css' === $return && isset( $array['condition'] ) && ! self::check_condition( $array['condition'] ) ) {
				continue;
			}

			// Attributes to loop through.
			if ( ! empty( $array['attributes'] ) ) {
				$attributes = $array['attributes'];
			} else {
				$attributes = [
					'font-family',
					'font-weight',
					'font-style',
					'font-size',
					'color',
					'line-height',
					'letter-spacing',
					'text-transform',
				];

				// Allow for margin on this setting if enabled.
				if ( isset( $array['margin'] ) && true === $array['margin'] ) {
					$attributes[] = 'margin';
				}

			}

			// Set attributes keys equal to vals.
			$attributes = \array_combine( $attributes, $attributes );

			// Exclude attributes.
			if ( ! empty( $array['exclude'] ) ) {
				foreach ( $array['exclude'] as $k => $v ) {
					unset( $attributes[ $v ] );
				}
			}

			// Define some vars before looping through attributes.
			$selector               = $array['target'];
			$css_vars               = $array['css_vars'] ?? [];
			$desktop_props          = '';
			$tablet_landscape_props = '';
			$tablet_portrait_props  = '';
			$phone_landscape_props  = '';
			$phone_portrait_props   = '';

			// Loop through attributes.
			foreach ( $attributes as $attribute ) {

				// Define attribute value.
				$val = $get_mod[ $attribute ] ?? null;

				if ( 'font-family' === $attribute && ! $this->is_font_supported( $val ) ) {
					$val = null;
				}

				// Val needed.
				if ( ! $val ) {
					continue;
				}

				// Sanitize property.
				$property = $css_vars[ $attribute ] ?? $attribute;

				// Font Sizes have responsive settings so we need to treat them differently.
				if ( 'font-size' === $attribute && \is_array( $val ) ) {

					$fontsize_pstyle = '';

					$responsive_bkpoints = [
						'd'  => '',
						'tl' => '',
						'tp' => '',
						'pl' => '',
						'pp' => '',
					];

					foreach ( $val as $k => $v ) {
						$val[ $k ] = $this->parse_attribute_val( $v, 'font-size' );
					}

					$val = \array_filter( $val );

					if ( ! $val ) {
						continue;
					}

					foreach ( $responsive_bkpoints as $bk_id => $bk_val ) {

						if ( ! empty( $val[ $bk_id ] ) ) {

							$bk_val = "{$property}:{$val[ $bk_id ]};";

							switch ( $bk_id ) {
								case 'd':
									if ( 'css' === $return ) {
										$desktop_props .= $bk_val;
									}
									$fontsize_pstyle .= "{$selector}{{$bk_val}}";
									break;
								case 'tl':
									if ( 'css' === $return ) {
										$tablet_landscape_props .= $bk_val;
									}
									$fontsize_pstyle .= "@media(max-width:1024px){{$selector}{{$bk_val};}}";
									break;
								case 'tp':
									if ( 'css' === $return ) {
										$tablet_portrait_props .= $bk_val;
									}
									$fontsize_pstyle .= "@media(max-width:959px){{$selector}{{$bk_val};}}";
									break;
								case 'pl':
									if ( 'css' === $return ) {
										$phone_landscape_props .= $bk_val;
									}
									$fontsize_pstyle .= "@media(max-width:767px){{$selector}{{$bk_val};}}";
									break;
								case 'pp':
									if ( 'css' === $return ) {
										$phone_portrait_props .= $bk_val;
									}
									$fontsize_pstyle .= "@media(max-width:479px){{$selector}{{$bk_val};}}";
									break;
							} // end switch

							if ( 'preview_styles' === $return ) {
								$preview_styles["wpex-customizer-{$element}-font-size"] = $fontsize_pstyle;
							}

						}

					}

				}

				// All other settings that aren't font sizes.
				else {

					// Parse the attribute value.
					$val = $this->parse_attribute_val( $val, $attribute );

					// No value for this setting.
					if ( ! $val ) {
						continue;
					}

					// Add to inline CSS.
					if ( 'margin' === $attribute && \str_contains( $val, ':' ) ) {
						$multi_prop_val = \totaltheme_parse_css_multi_property( $val, $attribute );
						if ( $multi_prop_val ) {
							$preview_css = '';
							foreach ( $multi_prop_val as $prop => $val ) {
								$property = $css_vars[ $prop ] ?? $prop;
								if ( 'css' === $return ) {
									$desktop_props .= "{$property}:{$val};";
								} elseif ( 'preview_styles' === $return ) {
									$preview_css .= "{$property}:{$val};";
								}
							}
						}
					} else {
						if ( 'css' === $return ) {
							$desktop_props .= "{$property}:{$val};";
						} elseif ( 'preview_styles' === $return ) {
							$preview_css = "{$property}:{$val};";
						}
					}

					// Customizer styles need to be added for each attribute.
					if ( 'preview_styles' === $return && ! empty( $preview_css ) ) {
						$preview_styles["wpex-customizer-{$element}-{$attribute}"] = "{$selector}{{$preview_css}}";
					}

				}

			} // End foreach attributes.

			// Add frontend responsive CSS.
			if ( $desktop_props ) {
				$css .= "{$selector}{{$desktop_props}}";
			}

			if ( $tablet_landscape_props ) {
				$tablet_landscape_css .= "{$selector}{{$tablet_landscape_props}}";
			}

			if ( $tablet_portrait_props ) {
				$tablet_portrait_css .=  "{$selector}{{$tablet_portrait_props}}";
			}

			if ( $phone_landscape_props ) {
				$phone_landscape_css .= "{$selector}{{$phone_landscape_props}}";
			}

			if ( $phone_portrait_props ) {
				$phone_portrait_css .= "{$selector}{{$phone_portrait_props}}";
			}

		} // End foreach settings.

		// Combine all settings CSS.
		if ( $css ) {
			$end_css .= $css;
		}

		// Combine all media query CSS for output.
		if ( $tablet_landscape_css ) {
			$end_css .= '@media(max-width:1024px){' . \esc_attr( $tablet_landscape_css ) . '}';
		}

		if ( $tablet_portrait_css ) {
			$end_css .= '@media(max-width:959px){' . \esc_attr( $tablet_portrait_css ) . '}';
		}

		if ( $phone_landscape_css ) {
			$end_css .= '@media(max-width:767px){' . \esc_attr( $phone_landscape_css ) . '}';
		}

		if ( $phone_portrait_css ) {
			$end_css .= '@media(max-width:479px){' . \esc_attr( $phone_portrait_css ) . '}';
		}

		// Add comment for typography css.
		if ( $css ) {
			$end_css = "/*TYPOGRAPHY*/{$end_css}";
		}

		switch ( $return ) {
			case 'css':
				return $end_css;
				break;
			case 'preview_styles':
				return $preview_styles;
				break;
		}

	}

	/**
	 * Outputs the typography custom CSS.
	 */
	public function frontend_css( $output ) {
		$typography_css = $this->loop( 'css' );
		if ( $typography_css ) {
			$output .= $typography_css;
		}
		return $output;
	}

	/**
	 * Returns correct CSS to output to wp_head.
	 */
	public function customize_css() {
		$styles = $this->loop( 'preview_styles' );

		if ( ! $styles || ! is_array( $styles ) ) {
			return;
		}

		foreach ( $styles as $style_key => $style_css ) {
			if ( empty( $style_css ) ) {
				continue;
			}
			echo '<style id="' . \esc_attr( $style_key ) . '">' . $style_css . '</style>';
		}
	}

	/**
	 * Loads Google fonts via wp_enqueue_style.
	 */
	public function frontend_enqueue_google_fonts() {
		$gfonts = [];

		if ( $custom_font = \get_theme_mod( 'load_custom_google_font_1' ) ) {
			$gfonts[] = $custom_font;
		}

		foreach ( $this->get_settings() as $setting_k => $setting_args ) {
			$mod_val = $this->get_setting_val( $setting_k, $setting_args );
			if ( empty( $mod_val['font-family'] )
				|| ! $this->setting_supports_css_property( 'font-family', $setting_args )
			) {
				continue;
			}
			$gfonts[] = $mod_val['font-family'];
		}

		if ( $gfonts ) {
			$gfonts = \array_unique( $gfonts );
			foreach ( $gfonts as $gfont ) {
				\wpex_enqueue_google_font( $gfont );
			}
		}
	}

	/**
	 * Return text transform choices.
	 */
	public function choices_text_transform() {
		return [
			''           => \esc_html__( 'Default', 'total' ),
			'capitalize' => \esc_html__( 'Capitalize', 'total' ),
			'lowercase'  => \esc_html__( 'Lowercase', 'total' ),
			'uppercase'  => \esc_html__( 'Uppercase', 'total' ),
			'none'       => \esc_html__( 'None', 'total' ),
		];
	}

	/**
	 * Return font style choices.
	 */
	public function choices_font_style() {
		return [
			''       => \esc_html__( 'Default', 'total' ),
			'normal' => \esc_html__( 'Normal', 'total' ),
			'italic' => \esc_html__( 'Italic', 'total' ),
		];
	}

	/**
	 * Return font weight choices.
	 */
	public function choices_font_weights() {
		return [
			''    => \esc_html__( 'Default', 'total' ),
			'100' => \esc_html__( 'Extra Light: 100', 'total' ),
			'200' => \esc_html__( 'Light: 200', 'total' ),
			'300' => \esc_html__( 'Book: 300', 'total' ),
			'400' => \esc_html__( 'Normal: 400', 'total' ),
			'500' => \esc_html__( 'Medium: 500', 'total' ),
			'600' => \esc_html__( 'Semibold: 600', 'total' ),
			'700' => \esc_html__( 'Bold: 700', 'total' ),
			'800' => \esc_html__( 'Extra Bold: 800', 'total' ),
			'900' => \esc_html__( 'Black: 900', 'total' ),
		];
	}

	/**
	 * Loads all registered fonts in the Customizer for use with Typography options.
	 */
	public function customize_enqueue_registered_fonts() {
		$user_fonts = (array) \wpex_get_registered_fonts();

		if ( empty( $user_fonts ) ) {
			return;
		}

		foreach ( $user_fonts as $user_font => $user_font_args ) {
			if ( 'other' === $user_font_args['type'] ) {
				continue;
			}
			\wpex_enqueue_font( $user_font, 'registered', $user_font_args );
		}
	}

	/**
	 * Return setting value.
	 */
	protected function get_setting_val( $setting = '' ) {
		return \get_theme_mod( "{$setting}_typography" );
	}

	/**
	 * Checks if a setting supports a specific CSS property.
	 */
	protected function setting_supports_css_property( $property = '', $setting_args = [] ): bool {
		return ( isset( $setting_args['attributes'][ $property ] ) || empty( $setting_args['exclude'] ) || ! \in_array( $property, $setting_args['exclude'] ) );
	}

	/**
	 * Parses an attribute value.
	 */
	protected function parse_attribute_val( $val = '', $attribute = '' ) {
		if ( $val && \is_string( $val ) ) {
			$val = \str_replace( '"', '', $val ); // remove any extra quotes (fix for older redux settings).
			return wpex_sanitize_data( $val, $attribute );
		}
	}

	/**
	 * Returns a list of supported fonts.
	 */
	protected function get_supported_fonts() {
		if ( null !== $this->supported_fonts ) {
			return $this->supported_fonts;
		}

		/**
		 * Support the disable Google font services function.
		 *
		 * If Google services is disabled and the user hasn't
		 * registered any fonts set the supported fonts to standard fonts
		 * plus any custom fonts added via legacy methods.
		 */
		if ( ! \wpex_has_google_services_support() && ! \wpex_has_registered_fonts() ) {
			$this->supported_fonts = \array_merge( \wpex_standard_fonts(), \wpex_add_custom_fonts() );
		} else {
			$this->supported_fonts = [];
		}

		return $this->supported_fonts;
	}

	/**
	 * Checks if a given font is supported.
	 *
	 * The font is supported if the supported_fonts array is empty or it exists in the array.
	 */
	protected function is_font_supported( $font ): bool {
		$supported_fonts = $this->get_supported_fonts();
		return ( ! $supported_fonts || \in_array( $font, $supported_fonts ) );
	}

	/**
	 * Checks setting condition.
	 */
	protected function check_condition( $condition ): bool {
		if ( \is_callable( $condition ) ) {
			return (bool) \call_user_func( $condition );
		}
		return (bool) $condition;
	}

	/**
	 * Parses a multi property theme mod.
	 */
	protected function parse_css_multi_property() {
		\_deprecated_function( __METHOD__, 'Total Theme 5.16' );
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit