403Webshell
Server IP : 52.25.153.185  /  Your IP : 216.73.217.131
Web Server : Apache
System : Linux ip-172-26-6-158 5.10.0-35-cloud-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : daemon ( 1)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /bitnami/wordpress/wp-content/plugins/testify/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bitnami/wordpress/wp-content/plugins/testify/includes/helpers.php
<?php
/**
 * This file includes code based on and/or copied from WordPress
 * See license.txt for copyright and licensing details
 *
 * This file includes code from the Divi theme by Elegant Themes
 * See license.txt for copyright and licensing details
 *
 * This file modified by Jonathan Hall, Dominika Rauk and/or others; last modified 2020-08-28
 *
 */

if (!defined('ABSPATH')) die();

function testify_sanitize_integer( $input ) {
	return absint($input);
}

function testify_sanitize_decimal( $input ) {
	return abs($input);
}

function testify_sanitize_boolean( $input ) {
	return (empty($input) ? 0 : 1);
}

function testify_sanitize_font_weight( $input ) {
	return (is_numeric($input) && $input >= 100 && $input <= 900 && $input % 100 == 0 ? $input : 400);
}

function testify_sanitize_thumb_per_row( $input ) {
	$input = absint($input);
	return ($input >= 0 && $input < 13 ? $input : 1);
}

function testify_sanitize_order( $input ) {
	$input = strtolower($input);
	return (in_array($input, array('random', 'date_asc')) ? $input : 'date_desc');
}

function testify_sanitize_align( $input ) {
	$input = strtolower($input);
	return (in_array($input, array('left', 'right')) ? $input : 'center');
}

function testify_sanitize_nav_type( $input ) {
	$input = strtolower($input);
	return (in_array($input, array('dots', 'thumbnails')) ? $input : '');
}

function testify_sanitize_transition_type($input) {
	$input = strtolower($input);
	return ($input == 'fade' || $input == 'slide' ? $input : 'none');
}

function testify_sanitize_image_shape($input) {
	$input = strtolower($input);
	return ($input == 'square' ? $input : 'circle');
}

function testify_sanitize_text($input) {
	return wp_strip_all_tags(wp_unslash($input));
}

function testify_process_font_icon( $font_icon, $forDivi=false ) {
	// the exact font icon value is saved
	$font_icon = trim( $font_icon );
	if ( strlen($font_icon) < 3 || $font_icon[0] != '%' ) {
		return $font_icon;
	}

	// the font icon value is saved in the following format: %%index_number%%
	$icon_index   = (int) str_replace( '%', '', $font_icon );
	$icon_symbols = testify_get_font_icon_symbols($forDivi);
	$font_icon    = isset( $icon_symbols[ $icon_index ] ) ? $icon_symbols[ $icon_index ] : '';

	return $font_icon;

}
function testify_get_font_icon_symbols($forDivi=false) {
	if ($forDivi) {
		$symbols = array( '&amp;#x21;', '&amp;#x22;', '&amp;#x23;', '&amp;#x24;', '&amp;#x25;', '&amp;#x26;', '&amp;#x27;', '&amp;#x28;', '&amp;#x29;', '&amp;#x2a;', '&amp;#x2b;', '&amp;#x2c;', '&amp;#x2d;', '&amp;#x2e;', '&amp;#x2f;', '&amp;#x30;', '&amp;#x31;', '&amp;#x32;', '&amp;#x33;', '&amp;#x34;', '&amp;#x35;', '&amp;#x36;', '&amp;#x37;', '&amp;#x38;', '&amp;#x39;', '&amp;#x3a;', '&amp;#x3b;', '&amp;#x3c;', '&amp;#x3d;', '&amp;#x3e;', '&amp;#x3f;', '&amp;#x40;', '&amp;#x41;', '&amp;#x42;', '&amp;#x43;', '&amp;#x44;', '&amp;#x45;', '&amp;#x46;', '&amp;#x47;', '&amp;#x48;', '&amp;#x49;', '&amp;#x4a;', '&amp;#x4b;', '&amp;#x4c;', '&amp;#x4d;', '&amp;#x4e;', '&amp;#x4f;', '&amp;#x50;', '&amp;#x51;', '&amp;#x52;', '&amp;#x53;', '&amp;#x54;', '&amp;#x55;', '&amp;#x56;', '&amp;#x57;', '&amp;#x58;', '&amp;#x59;', '&amp;#x5a;', '&amp;#x5b;', '&amp;#x5c;', '&amp;#x5d;', '&amp;#x5e;', '&amp;#x5f;', '&amp;#x60;', '&amp;#x61;', '&amp;#x62;', '&amp;#x63;', '&amp;#x64;', '&amp;#x65;', '&amp;#x66;', '&amp;#x67;', '&amp;#x68;', '&amp;#x69;', '&amp;#x6a;', '&amp;#x6b;', '&amp;#x6c;', '&amp;#x6d;', '&amp;#x6e;', '&amp;#x6f;', '&amp;#x70;', '&amp;#x71;', '&amp;#x72;', '&amp;#x73;', '&amp;#x74;', '&amp;#x75;', '&amp;#x76;', '&amp;#x77;', '&amp;#x78;', '&amp;#x79;', '&amp;#x7a;', '&amp;#x7b;', '&amp;#x7c;', '&amp;#x7d;', '&amp;#x7e;', '&amp;#xe000;', '&amp;#xe001;', '&amp;#xe002;', '&amp;#xe003;', '&amp;#xe004;', '&amp;#xe005;', '&amp;#xe006;', '&amp;#xe007;', '&amp;#xe009;', '&amp;#xe00a;', '&amp;#xe00b;', '&amp;#xe00c;', '&amp;#xe00d;', '&amp;#xe00e;', '&amp;#xe00f;', '&amp;#xe010;', '&amp;#xe011;', '&amp;#xe012;', '&amp;#xe013;', '&amp;#xe014;', '&amp;#xe015;', '&amp;#xe016;', '&amp;#xe017;', '&amp;#xe018;', '&amp;#xe019;', '&amp;#xe01a;', '&amp;#xe01b;', '&amp;#xe01c;', '&amp;#xe01d;', '&amp;#xe01e;', '&amp;#xe01f;', '&amp;#xe020;', '&amp;#xe021;', '&amp;#xe022;', '&amp;#xe023;', '&amp;#xe024;', '&amp;#xe025;', '&amp;#xe026;', '&amp;#xe027;', '&amp;#xe028;', '&amp;#xe029;', '&amp;#xe02a;', '&amp;#xe02b;', '&amp;#xe02c;', '&amp;#xe02d;', '&amp;#xe02e;', '&amp;#xe02f;', '&amp;#xe030;', '&amp;#xe103;', '&amp;#xe0ee;', '&amp;#xe0ef;', '&amp;#xe0e8;', '&amp;#xe0ea;', '&amp;#xe101;', '&amp;#xe107;', '&amp;#xe108;', '&amp;#xe102;', '&amp;#xe106;', '&amp;#xe0eb;', '&amp;#xe010;', '&amp;#xe105;', '&amp;#xe0ed;', '&amp;#xe100;', '&amp;#xe104;', '&amp;#xe0e9;', '&amp;#xe109;', '&amp;#xe0ec;', '&amp;#xe0fe;', '&amp;#xe0f6;', '&amp;#xe0fb;', '&amp;#xe0e2;', '&amp;#xe0e3;', '&amp;#xe0f5;', '&amp;#xe0e1;', '&amp;#xe0ff;', '&amp;#xe031;', '&amp;#xe032;', '&amp;#xe033;', '&amp;#xe034;', '&amp;#xe035;', '&amp;#xe036;', '&amp;#xe037;', '&amp;#xe038;', '&amp;#xe039;', '&amp;#xe03a;', '&amp;#xe03b;', '&amp;#xe03c;', '&amp;#xe03d;', '&amp;#xe03e;', '&amp;#xe03f;', '&amp;#xe040;', '&amp;#xe041;', '&amp;#xe042;', '&amp;#xe043;', '&amp;#xe044;', '&amp;#xe045;', '&amp;#xe046;', '&amp;#xe047;', '&amp;#xe048;', '&amp;#xe049;', '&amp;#xe04a;', '&amp;#xe04b;', '&amp;#xe04c;', '&amp;#xe04d;', '&amp;#xe04e;', '&amp;#xe04f;', '&amp;#xe050;', '&amp;#xe051;', '&amp;#xe052;', '&amp;#xe053;', '&amp;#xe054;', '&amp;#xe055;', '&amp;#xe056;', '&amp;#xe057;', '&amp;#xe058;', '&amp;#xe059;', '&amp;#xe05a;', '&amp;#xe05b;', '&amp;#xe05c;', '&amp;#xe05d;', '&amp;#xe05e;', '&amp;#xe05f;', '&amp;#xe060;', '&amp;#xe061;', '&amp;#xe062;', '&amp;#xe063;', '&amp;#xe064;', '&amp;#xe065;', '&amp;#xe066;', '&amp;#xe067;', '&amp;#xe068;', '&amp;#xe069;', '&amp;#xe06a;', '&amp;#xe06b;', '&amp;#xe06c;', '&amp;#xe06d;', '&amp;#xe06e;', '&amp;#xe06f;', '&amp;#xe070;', '&amp;#xe071;', '&amp;#xe072;', '&amp;#xe073;', '&amp;#xe074;', '&amp;#xe075;', '&amp;#xe076;', '&amp;#xe077;', '&amp;#xe078;', '&amp;#xe079;', '&amp;#xe07a;', '&amp;#xe07b;', '&amp;#xe07c;', '&amp;#xe07d;', '&amp;#xe07e;', '&amp;#xe07f;', '&amp;#xe080;', '&amp;#xe081;', '&amp;#xe082;', '&amp;#xe083;', '&amp;#xe084;', '&amp;#xe085;', '&amp;#xe086;', '&amp;#xe087;', '&amp;#xe088;', '&amp;#xe089;', '&amp;#xe08a;', '&amp;#xe08b;', '&amp;#xe08c;', '&amp;#xe08d;', '&amp;#xe08e;', '&amp;#xe08f;', '&amp;#xe090;', '&amp;#xe091;', '&amp;#xe092;', '&amp;#xe0f8;', '&amp;#xe0fa;', '&amp;#xe0e7;', '&amp;#xe0fd;', '&amp;#xe0e4;', '&amp;#xe0e5;', '&amp;#xe0f7;', '&amp;#xe0e0;', '&amp;#xe0fc;', '&amp;#xe0f9;', '&amp;#xe0dd;', '&amp;#xe0f1;', '&amp;#xe0dc;', '&amp;#xe0f3;', '&amp;#xe0d8;', '&amp;#xe0db;', '&amp;#xe0f0;', '&amp;#xe0df;', '&amp;#xe0f2;', '&amp;#xe0f4;', '&amp;#xe0d9;', '&amp;#xe0da;', '&amp;#xe0de;', '&amp;#xe0e6;', '&amp;#xe093;', '&amp;#xe094;', '&amp;#xe095;', '&amp;#xe096;', '&amp;#xe097;', '&amp;#xe098;', '&amp;#xe099;', '&amp;#xe09a;', '&amp;#xe09b;', '&amp;#xe09c;', '&amp;#xe09d;', '&amp;#xe09e;', '&amp;#xe09f;', '&amp;#xe0a0;', '&amp;#xe0a1;', '&amp;#xe0a2;', '&amp;#xe0a3;', '&amp;#xe0a4;', '&amp;#xe0a5;', '&amp;#xe0a6;', '&amp;#xe0a7;', '&amp;#xe0a8;', '&amp;#xe0a9;', '&amp;#xe0aa;', '&amp;#xe0ab;', '&amp;#xe0ac;', '&amp;#xe0ad;', '&amp;#xe0ae;', '&amp;#xe0af;', '&amp;#xe0b0;', '&amp;#xe0b1;', '&amp;#xe0b2;', '&amp;#xe0b3;', '&amp;#xe0b4;', '&amp;#xe0b5;', '&amp;#xe0b6;', '&amp;#xe0b7;', '&amp;#xe0b8;', '&amp;#xe0b9;', '&amp;#xe0ba;', '&amp;#xe0bb;', '&amp;#xe0bc;', '&amp;#xe0bd;', '&amp;#xe0be;', '&amp;#xe0bf;', '&amp;#xe0c0;', '&amp;#xe0c1;', '&amp;#xe0c2;', '&amp;#xe0c3;', '&amp;#xe0c4;', '&amp;#xe0c5;', '&amp;#xe0c6;', '&amp;#xe0c7;', '&amp;#xe0c8;', '&amp;#xe0c9;', '&amp;#xe0ca;', '&amp;#xe0cb;', '&amp;#xe0cc;', '&amp;#xe0cd;', '&amp;#xe0ce;', '&amp;#xe0cf;', '&amp;#xe0d0;', '&amp;#xe0d1;', '&amp;#xe0d2;', '&amp;#xe0d3;', '&amp;#xe0d4;', '&amp;#xe0d5;', '&amp;#xe0d6;', '&amp;#xe0d7;', '&amp;#xe600;', '&amp;#xe601;', '&amp;#xe602;', '&amp;#xe603;', '&amp;#xe604;', '&amp;#xe605;', '&amp;#xe606;', '&amp;#xe607;', '&amp;#xe608;', '&amp;#xe609;', '&amp;#xe60a;', '&amp;#xe60b;', '&amp;#xe60c;', '&amp;#xe60d;', '&amp;#xe60e;', '&amp;#xe60f;', '&amp;#xe610;', '&amp;#xe611;', '&amp;#xe612;', '&amp;#xe008;', );
	} else {
		// Following line based in part on FontAwesome - see fontawesome-code-license.txt and fontawesome-font-license.txt in the ../license directory for licensing and copyright information
		$symbols = array( '&amp;#xf26e;', '&amp;#xf2b9;', '&amp;#xf2ba;', '&amp;#xf2bb;', '&amp;#xf2bc;', '&amp;#xf042;', '&amp;#xf170;', '&amp;#xf037;', '&amp;#xf039;', '&amp;#xf036;', '&amp;#xf038;', '&amp;#xf270;', '&amp;#xf0f9;', '&amp;#xf2a3;', '&amp;#xf13d;', '&amp;#xf17b;', '&amp;#xf209;', '&amp;#xf103;', '&amp;#xf100;', '&amp;#xf101;', '&amp;#xf102;', '&amp;#xf107;', '&amp;#xf104;', '&amp;#xf105;', '&amp;#xf106;', '&amp;#xf179;', '&amp;#xf187;', '&amp;#xf1fe;', '&amp;#xf0ab;', '&amp;#xf0a8;', '&amp;#xf01a;', '&amp;#xf190;', '&amp;#xf18e;', '&amp;#xf01b;', '&amp;#xf0a9;', '&amp;#xf0aa;', '&amp;#xf063;', '&amp;#xf060;', '&amp;#xf061;', '&amp;#xf062;', '&amp;#xf047;', '&amp;#xf0b2;', '&amp;#xf07e;', '&amp;#xf07d;', '&amp;#xf2a2;', '&amp;#xf069;', '&amp;#xf1fa;', '&amp;#xf29e;', '&amp;#xf1b9;', '&amp;#xf04a;', '&amp;#xf24e;', '&amp;#xf05e;', '&amp;#xf2d5;', '&amp;#xf080;', '&amp;#xf02a;', '&amp;#xf0c9;', '&amp;#xf2cd;','&amp;#xf240;', '&amp;#xf244;', '&amp;#xf243;', '&amp;#xf242;', '&amp;#xf241;', '&amp;#xf236;', '&amp;#xf0fc;', '&amp;#xf1b4;', '&amp;#xf1b5;', '&amp;#xf0f3;', '&amp;#xf0a2;', '&amp;#xf1f6;', '&amp;#xf1f7;', '&amp;#xf206;', '&amp;#xf1e5;', '&amp;#xf1fd;', '&amp;#xf171;', '&amp;#xf172;', '&amp;#xf15a;', '&amp;#xf27e;', '&amp;#xf29d;', '&amp;#xf293;', '&amp;#xf294;', '&amp;#xf032;', '&amp;#xf0e7;', '&amp;#xf1e2;', '&amp;#xf02d;', '&amp;#xf02e;', '&amp;#xf097;', '&amp;#xf2a1;', '&amp;#xf0b1;', '&amp;#xf188;', '&amp;#xf1ad;', '&amp;#xf0f7;', '&amp;#xf0a1;', '&amp;#xf140;', '&amp;#xf207;', '&amp;#xf20d;', '&amp;#xf1ba;', '&amp;#xf1ec;', '&amp;#xf073;', '&amp;#xf274;', '&amp;#xf272;', '&amp;#xf133;', '&amp;#xf271;', '&amp;#xf273;', '&amp;#xf030;', '&amp;#xf083;', '&amp;#xf0d7;', '&amp;#xf0d9;', '&amp;#xf0da;', '&amp;#xf150;', '&amp;#xf191;', '&amp;#xf152;', '&amp;#xf151;', '&amp;#xf0d8;', '&amp;#xf218;', '&amp;#xf217;', '&amp;#xf20a;', '&amp;#xf1f3;', '&amp;#xf24c;', '&amp;#xf1f2;', '&amp;#xf24b;', '&amp;#xf1f1;', '&amp;#xf1f4;', '&amp;#xf1f5;', '&amp;#xf1f0;', '&amp;#xf0a3;', '&amp;#xf0c1;', '&amp;#xf127;', '&amp;#xf00c;', '&amp;#xf058;', '&amp;#xf05d;', '&amp;#xf14a;', '&amp;#xf046;', '&amp;#xf13a;', '&amp;#xf137;', '&amp;#xf138;', '&amp;#xf139;', '&amp;#xf078;', '&amp;#xf053;', '&amp;#xf054;', '&amp;#xf077;', '&amp;#xf1ae;', '&amp;#xf268;', '&amp;#xf111;', '&amp;#xf10c;', '&amp;#xf1ce;', '&amp;#xf1db;', '&amp;#xf0ea;', '&amp;#xf017;', '&amp;#xf24d;', '&amp;#xf00d;', '&amp;#xf0c2;', '&amp;#xf0ed;', '&amp;#xf0ee;', '&amp;#xf157;', '&amp;#xf121;', '&amp;#xf126;', '&amp;#xf1cb;', '&amp;#xf284;', '&amp;#xf0f4;', '&amp;#xf013;', '&amp;#xf085;', '&amp;#xf0db;', '&amp;#xf075;', '&amp;#xf0e5;', '&amp;#xf27a;', '&amp;#xf27b;', '&amp;#xf086;', '&amp;#xf0e6;', '&amp;#xf14e;', '&amp;#xf066;', '&amp;#xf20e;', '&amp;#xf26d;', '&amp;#xf0c5;', '&amp;#xf1f9;', '&amp;#xf25e;', '&amp;#xf09d;', '&amp;#xf283;', '&amp;#xf125;', '&amp;#xf05b;', '&amp;#xf13c;', '&amp;#xf1b2;', '&amp;#xf1b3;', '&amp;#xf0c4;', '&amp;#xf0f5;', '&amp;#xf0e4;', '&amp;#xf210;', '&amp;#xf1c0;', '&amp;#xf2a4;', '&amp;#xf03b;', '&amp;#xf1a5;', '&amp;#xf108;', '&amp;#xf1bd;', '&amp;#xf219;', '&amp;#xf1a6;', '&amp;#xf155;', '&amp;#xf192;', '&amp;#xf019;', '&amp;#xf17d;', '&amp;#xf2c2;', '&amp;#xf2c3;', '&amp;#xf16b;', '&amp;#xf1a9;', '&amp;#xf282;', '&amp;#xf044;', '&amp;#xf2da;', '&amp;#xf052;', '&amp;#xf141;', '&amp;#xf142;', '&amp;#xf1d1;', '&amp;#xf0e0;', '&amp;#xf003;', '&amp;#xf2b6;', '&amp;#xf2b7;', '&amp;#xf199;', '&amp;#xf299;', '&amp;#xf12d;', '&amp;#xf2d7;', '&amp;#xf153;', '&amp;#xf0ec;', '&amp;#xf12a;', '&amp;#xf06a;', '&amp;#xf071;', '&amp;#xf065;', '&amp;#xf23e;', '&amp;#xf08e;', '&amp;#xf14c;', '&amp;#xf06e;', '&amp;#xf070;', '&amp;#xf1fb;', '&amp;#xf2b4;', '&amp;#xf09a;', '&amp;#xf230;', '&amp;#xf082;', '&amp;#xf049;', '&amp;#xf050;', '&amp;#xf1ac;', '&amp;#xf09e;', '&amp;#xf182;', '&amp;#xf0fb;', '&amp;#xf15b;', '&amp;#xf1c6;', '&amp;#xf1c7;', '&amp;#xf1c9;', '&amp;#xf1c3;', '&amp;#xf1c5;', '&amp;#xf1c8;', '&amp;#xf016;', '&amp;#xf1c1;', '&amp;#xf1c4;', '&amp;#xf15c;', '&amp;#xf0f6;', '&amp;#xf1c2;', '&amp;#xf008;', '&amp;#xf0b0;', '&amp;#xf06d;', '&amp;#xf134;', '&amp;#xf269;', '&amp;#xf2b0;', '&amp;#xf024;', '&amp;#xf11e;', '&amp;#xf11d;', '&amp;#xf0c3;', '&amp;#xf16e;', '&amp;#xf0c7;', '&amp;#xf07b;', '&amp;#xf114;', '&amp;#xf07c;', '&amp;#xf115;', '&amp;#xf031;',  '&amp;#xf280;', '&amp;#xf286;', '&amp;#xf211;', '&amp;#xf04e;', '&amp;#xf180;', '&amp;#xf2c5;', '&amp;#xf119;', '&amp;#xf1e3;', '&amp;#xf11b;', '&amp;#xf0e3;', '&amp;#xf154;', '&amp;#xf22d;', '&amp;#xf265;', '&amp;#xf260;', '&amp;#xf261;', '&amp;#xf06b;', '&amp;#xf1d3;', '&amp;#xf1d2;', '&amp;#xf09b;', '&amp;#xf113;', '&amp;#xf092;', '&amp;#xf296;', '&amp;#xf184;', '&amp;#xf000;', '&amp;#xf2a5;', '&amp;#xf2a6;', '&amp;#xf0ac;', '&amp;#xf1a0;', '&amp;#xf0d5;', '&amp;#xf2b3;', '&amp;#xf0d4;', '&amp;#xf1ee;', '&amp;#xf19d;', '&amp;#xf2d6;', '&amp;#xf0c0;', '&amp;#xf0fd;', '&amp;#xf1d4;', '&amp;#xf255;', '&amp;#xf258;', '&amp;#xf0a7;', '&amp;#xf0a5;', '&amp;#xf0a4;', '&amp;#xf0a6;', '&amp;#xf256;', '&amp;#xf25b;', '&amp;#xf25a;', '&amp;#xf257;', '&amp;#xf259;', '&amp;#xf2b5;', '&amp;#xf292;', '&amp;#xf0a0;', '&amp;#xf1dc;', '&amp;#xf025;', '&amp;#xf004;', '&amp;#xf08a;', '&amp;#xf21e;', '&amp;#xf1da;', '&amp;#xf015;', '&amp;#xf0f8;', '&amp;#xf254;', '&amp;#xf251;', '&amp;#xf252;', '&amp;#xf253;', '&amp;#xf250;', '&amp;#xf27c;', '&amp;#xf13b;', '&amp;#xf246;', '&amp;#xf2c1;', '&amp;#xf20b;', '&amp;#xf03e;', '&amp;#xf2d8;', '&amp;#xf01c;', '&amp;#xf03c;', '&amp;#xf275;', '&amp;#xf129;', '&amp;#xf05a;', '&amp;#xf156;', '&amp;#xf16d;', '&amp;#xf19c;', '&amp;#xf26b;', '&amp;#xf224;', '&amp;#xf208;', '&amp;#xf033;', '&amp;#xf1aa;', '&amp;#xf1cc;', '&amp;#xf084;', '&amp;#xf11c;', '&amp;#xf159;', '&amp;#xf1ab;', '&amp;#xf109;', '&amp;#xf202;', '&amp;#xf203;', '&amp;#xf06c;', '&amp;#xf212;', '&amp;#xf094;', '&amp;#xf149;', '&amp;#xf148;', '&amp;#xf0eb;', '&amp;#xf201;',  '&amp;#xf0e1;', '&amp;#xf08c;', '&amp;#xf2b8;', '&amp;#xf17c;', '&amp;#xf03a;', '&amp;#xf022;', '&amp;#xf0cb;', '&amp;#xf0ca;', '&amp;#xf124;', '&amp;#xf023;', '&amp;#xf175;', '&amp;#xf177;', '&amp;#xf178;', '&amp;#xf176;', '&amp;#xf2a8;', '&amp;#xf0d0;', '&amp;#xf076;', '&amp;#xf064;', '&amp;#xf112;', '&amp;#xf122;', '&amp;#xf183;', '&amp;#xf279;', '&amp;#xf041;', '&amp;#xf278;', '&amp;#xf276;', '&amp;#xf277;', '&amp;#xf222;', '&amp;#xf227;', '&amp;#xf229;', '&amp;#xf22b;', '&amp;#xf22a;', '&amp;#xf136;', '&amp;#xf20c;', '&amp;#xf23a;', '&amp;#xf0fa;', '&amp;#xf2e0;', '&amp;#xf11a;', '&amp;#xf223;', '&amp;#xf2db;', '&amp;#xf130;', '&amp;#xf131;', '&amp;#xf068;', '&amp;#xf056;', '&amp;#xf146;', '&amp;#xf147;', '&amp;#xf289;', '&amp;#xf10b;', '&amp;#xf285;', '&amp;#xf0d6;', '&amp;#xf186;', '&amp;#xf21c;', '&amp;#xf245;', '&amp;#xf001;', '&amp;#xf22c;', '&amp;#xf1ea;', '&amp;#xf247;', '&amp;#xf248;', '&amp;#xf263;', '&amp;#xf264;', '&amp;#xf23d;', '&amp;#xf19b;', '&amp;#xf26a;', '&amp;#xf23c;', '&amp;#xf18c;', '&amp;#xf1fc;', '&amp;#xf1d8;', '&amp;#xf1d9;', '&amp;#xf0c6;', '&amp;#xf1dd;', '&amp;#xf04c;', '&amp;#xf28b;', '&amp;#xf28c;', '&amp;#xf1b0;', '&amp;#xf1ed;', '&amp;#xf040;', '&amp;#xf14b;', '&amp;#xf295;', '&amp;#xf095;', '&amp;#xf098;', '&amp;#xf200;', '&amp;#xf2ae;', '&amp;#xf1a8;', '&amp;#xf1a7;', '&amp;#xf0d2;', '&amp;#xf231;', '&amp;#xf0d3;', '&amp;#xf072;', '&amp;#xf04b;', '&amp;#xf144;', '&amp;#xf01d;', '&amp;#xf1e6;', '&amp;#xf067;', '&amp;#xf055;', '&amp;#xf0fe;', '&amp;#xf196;', '&amp;#xf2ce;', '&amp;#xf011;', '&amp;#xf02f;', '&amp;#xf288;', '&amp;#xf12e;', '&amp;#xf1d6;', '&amp;#xf029;', '&amp;#xf128;', '&amp;#xf059;', '&amp;#xf29c;', '&amp;#xf2c4;', '&amp;#xf10d;', '&amp;#xf10e;', '&amp;#xf1d0;', '&amp;#xf074;', '&amp;#xf2d9;', '&amp;#xf1b8;', '&amp;#xf1a1;', '&amp;#xf281;', '&amp;#xf1a2;', '&amp;#xf021;', '&amp;#xf25d;', '&amp;#xf18b;', '&amp;#xf01e;', '&amp;#xf079;', '&amp;#xf018;', '&amp;#xf135;', '&amp;#xf0e2;', '&amp;#xf158;', '&amp;#xf143;', '&amp;#xf267;', '&amp;#xf28a;', '&amp;#xf002;', '&amp;#xf010;', '&amp;#xf00e;', '&amp;#xf213;', '&amp;#xf233;', '&amp;#xf1e0;', '&amp;#xf1e1;', '&amp;#xf14d;', '&amp;#xf045;', '&amp;#xf132;', '&amp;#xf21a;', '&amp;#xf214;', '&amp;#xf290;', '&amp;#xf291;', '&amp;#xf07a;', '&amp;#xf2cc;', '&amp;#xf090;', '&amp;#xf2a7;', '&amp;#xf08b;', '&amp;#xf012;', '&amp;#xf215;', '&amp;#xf0e8;', '&amp;#xf216;', '&amp;#xf17e;', '&amp;#xf198;', '&amp;#xf1de;', '&amp;#xf1e7;', '&amp;#xf118;', '&amp;#xf2ab;', '&amp;#xf2ac;', '&amp;#xf2ad;', '&amp;#xf2dc;', '&amp;#xf0dc;', '&amp;#xf15d;', '&amp;#xf15e;', '&amp;#xf160;', '&amp;#xf161;', '&amp;#xf0de;', '&amp;#xf0dd;', '&amp;#xf162;', '&amp;#xf163;', '&amp;#xf1be;', '&amp;#xf197;', '&amp;#xf110;', '&amp;#xf1b1;', '&amp;#xf1bc;', '&amp;#xf0c8;', '&amp;#xf096;', '&amp;#xf18d;', '&amp;#xf16c;', '&amp;#xf005;', '&amp;#xf089;', '&amp;#xf123;', '&amp;#xf006;', '&amp;#xf1b6;', '&amp;#xf1b7;', '&amp;#xf048;', '&amp;#xf051;', '&amp;#xf0f1;', '&amp;#xf249;', '&amp;#xf24a;', '&amp;#xf04d;', '&amp;#xf28d;', '&amp;#xf28e;', '&amp;#xf21d;', '&amp;#xf0cc;', '&amp;#xf1a4;', '&amp;#xf1a3;', '&amp;#xf12c;', '&amp;#xf239;', '&amp;#xf0f2;', '&amp;#xf185;', '&amp;#xf2dd;', '&amp;#xf12b;', '&amp;#xf1cd;', '&amp;#xf0ce;', '&amp;#xf10a;', '&amp;#xf02b;', '&amp;#xf02c;', '&amp;#xf0ae;', '&amp;#xf2c6;', '&amp;#xf26c;', '&amp;#xf1d5;', '&amp;#xf120;', '&amp;#xf034;', '&amp;#xf035;', '&amp;#xf00a;', '&amp;#xf009;', '&amp;#xf00b;', '&amp;#xf2b2;', '&amp;#xf2c7;', '&amp;#xf2cb;', '&amp;#xf2ca;', '&amp;#xf2c9;', '&amp;#xf2c8;', '&amp;#xf08d;', '&amp;#xf165;', '&amp;#xf088;', '&amp;#xf087;', '&amp;#xf164;', '&amp;#xf145;', '&amp;#xf057;', '&amp;#xf05c;', '&amp;#xf2d3;', '&amp;#xf2d4;', '&amp;#xf043;', '&amp;#xf204;', '&amp;#xf205;', '&amp;#xf25c;', '&amp;#xf238;', '&amp;#xf225;', '&amp;#xf1f8;', '&amp;#xf014;', '&amp;#xf1bb;', '&amp;#xf181;', '&amp;#xf262;', '&amp;#xf091;', '&amp;#xf0d1;', '&amp;#xf195;', '&amp;#xf1e4;', '&amp;#xf173;', '&amp;#xf174;', '&amp;#xf1e8;', '&amp;#xf099;', '&amp;#xf081;', '&amp;#xf0e9;', '&amp;#xf0cd;', '&amp;#xf29a;', '&amp;#xf09c;', '&amp;#xf13e;', '&amp;#xf093;', '&amp;#xf287;', '&amp;#xf007;', '&amp;#xf2bd;', '&amp;#xf2be;', '&amp;#xf0f0;', '&amp;#xf2c0;', '&amp;#xf234;', '&amp;#xf21b;', '&amp;#xf235;', '&amp;#xf221;', '&amp;#xf226;', '&amp;#xf228;', '&amp;#xf237;', '&amp;#xf2a9;', '&amp;#xf2aa;', '&amp;#xf03d;', '&amp;#xf27d;', '&amp;#xf194;', '&amp;#xf1ca;', '&amp;#xf189;', '&amp;#xf2a0;', '&amp;#xf027;', '&amp;#xf026;', '&amp;#xf028;', '&amp;#xf1d7;', '&amp;#xf18a;', '&amp;#xf232;', '&amp;#xf193;', '&amp;#xf29b;', '&amp;#xf1eb;', '&amp;#xf266;', '&amp;#xf2d0;', '&amp;#xf2d1;', '&amp;#xf2d2;', '&amp;#xf17a;', '&amp;#xf19a;', '&amp;#xf297;', '&amp;#xf2de;', '&amp;#xf298;', '&amp;#xf0ad;', '&amp;#xf168;', '&amp;#xf169;', '&amp;#xf23b;', '&amp;#xf19e;', '&amp;#xf1e9;', '&amp;#xf2b1;', '&amp;#xf167;', '&amp;#xf16a;', '&amp;#xf166;' );

		$symbols = apply_filters('testify_font_icon_symbols', $symbols);
	}
	
	
	return $symbols;
}

function testify_get_font_icon_list( $active = null ) {
	$output = is_customize_preview() ? testify_get_font_icon_list_items( $active ) : '<%= window.testify.font_icon_list_template() %> <%= window.testify.font_icon_list_active() %>';

	$output = sprintf( '<ul class="testify_font_icon">%1$s</ul>', $output );

	return $output;
}

function testify_get_font_icon_list_items( $active = null ) {
	
	$output = '';
	
	$class = '';
	
	$symbols = testify_get_font_icon_symbols();
	
	foreach ( $symbols as $symbol ) {
		
		if ( testify_process_font_icon($active) == $symbol ) {
			
			$class = ' class="testify_active"';
		}
		
		$output .= sprintf( '<li data-icon=\'%1$s\'%2$s></li>', esc_attr( $symbol ), $class );
		
		$class = '';
	}
	
	return $output;
}

function testify_font_options() {
	$options         = array();

	$default_options = array( 'default' => array(
		'name' => esc_html__( 'Default', 'testify-testify' ),
	) );
	$fonts           = array_merge( $default_options, testify_get_fonts() );

	foreach ( $fonts as $font_name => $font_settings ) {
		$options[ $font_name ] = 'default' !== $font_name ? $font_name : $font_settings['name'];
	}

	return $options;
}

function testify_get_font_options_items() {
	$output = '';
	$font_options = testify_font_options();

	foreach ( $font_options as $key => $value ) {
		$output .= sprintf(
			'<option value="%1$s">%2$s</option>',
			esc_attr( $key ),
			esc_html( $value )
		);
	}

	return $output;
}

function testify_process_range_value( $range, $option_type = '' ) {
	$range = trim( $range );
	$range_digit = floatval( $range );
	$range_string = str_replace( $range_digit, '', (string) $range );

	if ( '' === $range_string ) {
		$range_string = 'line_height' === $option_type && 3 >= $range_digit ? 'em' : 'px';
	}

	$result = $range_digit . $range_string;

	return apply_filters( 'testify_processed_range_value', $result, $range, $range_string );
}

function testify_set_element_font( $font, $use_important = false, $default = false ) {
	$style = '';

	if ( '' === $font ) {
		return $style;
	}

	$font_values = explode( '|', $font );
	$default = ! $default ? "||||" : $default;
	$font_values_default = explode( '|', $default );

	if ( ! empty( $font_values ) ) {
		$font_values       = array_map( 'trim', $font_values );
		$font_name         = $font_values[0];
		
		$is_font_bold      = isset( $font_values[1] ) && 'on' === $font_values[1] ? true : false;
		$is_font_italic    = isset( $font_values[2] ) && 'on' === $font_values[2] ? true : false;
		$is_font_uppercase = isset( $font_values[3] ) && 'on' === $font_values[3] ? true : false;
		$is_font_underline = isset( $font_values[4] ) && 'on' === $font_values[4] ? true : false;
		
		$font_name_default         = $font_values_default[0];
		$is_font_bold_default      = 'on' === $font_values_default[1] ? true : false;
		$is_font_italic_default    = 'on' === $font_values_default[2] ? true : false;
		$is_font_uppercase_default = 'on' === $font_values_default[3] ? true : false;
		$is_font_underline_default = 'on' === $font_values_default[4] ? true : false;

		if ( '' !== $font_name && $font_name_default !== $font_name ) {
			testify_enqueue_font( $font_name );

			$style .= testify_get_font_family( $font_name, $use_important ) . ' ';
		}

		$style .= testify_set_element_font_style( 'font-weight', $is_font_bold_default, $is_font_bold, 'normal', 'bold', $use_important );

		$style .= testify_set_element_font_style( 'font-style', $is_font_italic_default, $is_font_italic, 'none', 'italic', $use_important );

		$style .= testify_set_element_font_style( 'text-transform', $is_font_uppercase_default, $is_font_uppercase, 'none', 'uppercase', $use_important );

		$style .= testify_set_element_font_style( 'text-decoration', $is_font_underline_default, $is_font_underline, 'none', 'underline', $use_important );

		$style = rtrim( $style );
	}

	return $style;
}

function testify_set_element_font_style( $property, $default, $value, $property_default, $property_value, $use_important ) {
	$style = "";

	if ( $value && ! $default ) {
		$style = sprintf(
			'%1$s: %2$s%3$s; ',
			esc_html( $property ),
			$property_value,
			( $use_important ? ' !important' : '' )
		);
	} elseif ( ! $value && $default ) {
		$style = sprintf(
			'%1$s: %2$s%3$s; ',
			esc_html( $property ),
			$property_default,
			( $use_important ? ' !important' : '' )
		);
	}

	return $style;
}

function testify_enqueue_font( $font_name ) {
	$fonts = testify_get_fonts();
	$websafe_fonts = testify_get_websafe_fonts();
	$protocol = is_ssl() ? 'https' : 'http';

	// Skip enqueueing if font name is not found. Possibly happen if support for particular font need to be dropped
	if ( ! array_key_exists( $font_name, $fonts ) ) {
		return;
	}

	// Skip enqueueing for websafe fonts
	if ( array_key_exists( $font_name, $websafe_fonts ) ) {
		return;
	}

	if ( isset( $fonts[ $font_name ]['parent_font'] ) ){
		$font_name = $fonts[ $font_name ]['parent_font'];
	}
	$font_character_set = $fonts[ $font_name ]['character_set'];

	$query_args = array(
		'family' => sprintf( '%s:%s',
			str_replace( ' ', '+', $font_name ),
			apply_filters( 'testify_set_styles', $fonts[ $font_name ]['styles'], $font_name )
		),
		'subset' => apply_filters( 'testify_set_character_set', $font_character_set, $font_name ),
	);

	$font_name_slug = sprintf(
		'et-gf-%1$s',
		strtolower( str_replace( ' ', '-', $font_name ) )
	);

	wp_enqueue_style( $font_name_slug, esc_url( add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) ), array(), null );
}

function testify_get_font_family( $font_name, $use_important = false ) {
	$fonts = testify_get_fonts();

	$font_style = $font_weight = '';

	$font_name_ms = isset( $fonts[ $font_name ] ) && isset( $fonts[ $font_name ]['add_ms_version'] ) ? "'{$font_name} MS', " : "";

	if ( isset( $fonts[ $font_name ]['parent_font'] ) ){
		$font_style = $fonts[ $font_name ]['styles'];
		$font_name = $fonts[ $font_name ]['parent_font'];
	}

	if ( '' !== $font_style ) {
		$font_weight = sprintf( ' font-weight: %1$s;', esc_html( $font_style ) );
	}

	$style = sprintf( 'font-family: \'%1$s\', %5$s%2$s%3$s;%4$s',
		esc_html( $font_name ),
		isset( $fonts[ $font_name ] ) ? testify_get_websafe_font_stack( $fonts[ $font_name ]['type'] ) : "",
		( $use_important ? ' !important' : '' ),
		$font_weight,
		$font_name_ms
	);

	return $style;
}

function testify_get_websafe_font_stack( $type = 'sans-serif' ) {
	$font_stack = '';

	switch ( $type ) {
		case 'sans-serif':
			$font_stack = 'Helvetica, Arial, Lucida, sans-serif';
			break;
		case 'serif':
			$font_stack = 'Georgia, Times New Roman, serif';
			break;
		case 'cursive':
			$font_stack = 'cursive';
			break;
	}

	return $font_stack;
}

function testify_get_websafe_fonts() {
	$websafe_fonts = array(
		'Arial' => array(
			'styles' 		=> '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
			'character_set' => 'arabic,cyrillic,greek,hebrew,latin',
			'type'			=> 'sans-serif',
		),
		'Georgia' => array(
			'styles' 		=> '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
			'character_set' => 'cyrillic,greek,latin',
			'type'			=> 'serif',
		),
		'Times New Roman' => array(
			'styles' 		=> '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
			'character_set' => 'arabic,cyrillic,greek,hebrew,latin',
			'type'			=> 'serif',
		),
		'Trebuchet' => array(
			'styles' 		=> '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
			'character_set' => 'cyrillic,latin',
			'type'			=> 'sans-serif',
			'add_ms_version'=> true,
		),
		'Verdana' => array(
			'styles' 		=> '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
			'character_set' => 'cyrillic,latin',
			'type'			=> 'sans-serif',
		),
	);

	$_websafe_fonts = array();
	
	foreach ( $websafe_fonts as $font_name => $settings ) {
		$settings['standard'] = true;

		$_websafe_fonts[ $font_name ] = $settings;
	}
	
	$websafe_fonts = $_websafe_fonts;

	return apply_filters( 'et_websafe_fonts', $websafe_fonts );
}

function testify_get_google_fonts() {
	$google_fonts = array(
		'Abel' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'sans-serif',
		),
		'Amatic SC' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Arimo' => array(
			'styles' 		=> '400,400italic,700italic,700',
			'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
			'type'			=> 'sans-serif',
		),
		'Arvo' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Bevan' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Bitter' => array(
			'styles' 		=> '400,400italic,700',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'serif',
		),
		'Black Ops One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Boogaloo' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Bree Serif' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'serif',
		),
		'Calligraffitti' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Cantata One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'serif',
		),
		'Cardo' => array(
			'styles' 		=> '400,400italic,700',
			'character_set' => 'latin,greek-ext,greek,latin-ext',
			'type'			=> 'serif',
		),
		'Changa One' => array(
			'styles' 		=> '400,400italic',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Cherry Cream Soda' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Chewy' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Comfortaa' => array(
			'styles' 		=> '400,300,700',
			'character_set' => 'latin,cyrillic-ext,greek,latin-ext,cyrillic',
			'type'			=> 'cursive',
		),
		'Coming Soon' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Covered By Your Grace' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Crafty Girls' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Crete Round' => array(
			'styles' 		=> '400,400italic',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'serif',
		),
		'Crimson Text' => array(
			'styles' 		=> '400,400italic,600,600italic,700,700italic',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Cuprum' => array(
			'styles' 		=> '400,400italic,700italic,700',
			'character_set' => 'latin,latin-ext,cyrillic',
			'type'			=> 'sans-serif',
		),
		'Dancing Script' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin,vietnamese,latin-ext',
			'type'			=> 'cursive',
		),
		'Dosis' => array(
			'styles' 		=> '400,200,300,500,600,700,800',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Droid Sans' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin',
			'type'			=> 'sans-serif',
		),
		'Droid Serif' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Francois One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Fredoka One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'The Girl Next Door' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Gloria Hallelujah' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Happy Monkey' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Indie Flower' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Josefin Slab' => array(
			'styles' 		=> '400,100,100italic,300,300italic,400italic,600,700,700italic,600italic',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Judson' => array(
			'styles' 		=> '400,400italic,700',
			'character_set' => 'latin,vietnamese,latin-ext',
			'type'			=> 'serif',
		),
		'Kreon' => array(
			'styles' 		=> '400,300,700',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Lato' => array(
			'styles' 		=> '400,100,100italic,300,300italic,400italic,700,700italic,900,900italic',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Lato Light' => array(
			'parent_font' => 'Lato',
			'styles'      => '300',
		),
		'Leckerli One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Lobster' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic',
			'type'			=> 'cursive',
		),
		'Lobster Two' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Lora' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'cyrillic,cyrillic-ext,vietnamese,latin,latin-ext',
			'type'			=> 'serif',
		),
		'Luckiest Guy' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Merriweather' => array(
			'styles' 		=> '400,300,900,700',
			'character_set' => 'cyrillic,cyrillic-ext,latin,latin-ext',
			'type'			=> 'serif',
		),
		'Metamorphous' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Montserrat' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin',
			'type'			=> 'sans-serif',
		),
		'Noticia Text' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'latin,vietnamese,latin-ext',
			'type'			=> 'serif',
		),
		'Nova Square' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Nunito' => array(
			'styles' 		=> '400,300,700',
			'character_set' => 'vietnamese,latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Old Standard TT' => array(
			'styles' 		=> '400,400italic,700',
			'character_set' => 'cyrillic,cyrillic-ext,vietnamese,latin,latin-ext',
			'type'			=> 'serif',
		),
		'Open Sans' => array(
			'styles' 		=> '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
			'character_set' => 'latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic',
			'type'			=> 'sans-serif',
		),
		'Open Sans Condensed' => array(
			'styles' 		=> '300,300italic,700',
			'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,greek,vietnamese,cyrillic',
			'type'			=> 'sans-serif',
		),
		'Open Sans Light' => array(
			'parent_font' => 'Open Sans',
			'styles'      => '300',
		),
		'Oswald' => array(
			'styles' 		=> '400,300,700',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Pacifico' => array(
			'styles' 		=> '400',
			'character_set' => 'vietnamese,latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Passion One' => array(
			'styles' 		=> '400,700,900',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Patrick Hand' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,vietnamese,latin-ext',
			'type'			=> 'cursive',
		),
		'Permanent Marker' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Play' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Playfair Display' => array(
			'styles' 		=> '400,400italic,700,700italic,900italic,900',
			'character_set' => 'latin,latin-ext,cyrillic',
			'type'			=> 'serif',
		),
		'Poiret One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext,cyrillic',
			'type'			=> 'cursive',
		),
		'PT Sans' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'latin,latin-ext,cyrillic',
			'type'			=> 'sans-serif',
		),
		'PT Sans Narrow' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin,latin-ext,cyrillic',
			'type'			=> 'sans-serif',
		),
		'PT Serif' => array(
			'styles' 		=> '400,400italic,700,700italic',
			'character_set' => 'latin,cyrillic',
			'type'			=> 'serif',
		),
		'Raleway' => array(
			'styles' 		=> '400,100,200,300,600,500,700,800,900',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Raleway Light' => array(
			'parent_font' => 'Raleway',
			'styles'      => '300',
		),
		'Reenie Beanie' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Righteous' => array(
			'styles' 		=> '400',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'cursive',
		),
		'Roboto' => array(
			'styles' 		=> '400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic',
			'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese',
			'type'			=> 'sans-serif',
		),
		'Roboto Condensed' => array(
			'styles' 		=> '400,300,300italic,400italic,700,700italic',
			'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
			'type'			=> 'sans-serif',
		),
		'Roboto Light' => array(
			'parent_font' => 'Roboto',
			'styles'      => '100',
		),
		'Rock Salt' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Rokkitt' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Sanchez' => array(
			'styles' 		=> '400,400italic',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'serif',
		),
		'Satisfy' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Schoolbell' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Shadows Into Light' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Source Sans Pro' => array(
			'styles' 		=> '400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900,900italic',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Source Sans Pro Light' => array(
			'parent_font' => 'Source Sans Pro',
			'styles'      => '300',
		),
		'Special Elite' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Squada One' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Tangerine' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Ubuntu' => array(
			'styles' 		=> '400,300,300italic,400italic,500,500italic,700,700italic',
			'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
			'type'			=> 'sans-serif',
		),
		'Unkempt' => array(
			'styles' 		=> '400,700',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Vollkorn' => array(
			'styles' 		=> '400,400italic,700italic,700',
			'character_set' => 'latin',
			'type'			=> 'serif',
		),
		'Walter Turncoat' => array(
			'styles' 		=> '400',
			'character_set' => 'latin',
			'type'			=> 'cursive',
		),
		'Yanone Kaffeesatz' => array(
			'styles' 		=> '400,200,300,700',
			'character_set' => 'latin,latin-ext',
			'type'			=> 'sans-serif',
		),
	);

	return apply_filters( 'testify_google_fonts', $google_fonts );
}

function testify_get_fonts( $settings = array() ) {
	$defaults = array(
		'prepend_standard_fonts' => true,
	);

	$settings = wp_parse_args( $settings, $defaults );

	$fonts = $settings['prepend_standard_fonts']
		? array_merge( testify_get_websafe_fonts(), testify_get_google_fonts() )
		: array_merge( testify_get_google_fonts(), testify_get_websafe_fonts() );

	return $fonts;
}

function testify_get_fonts_options() {
	
	$options = [];
	
	$fonts = testify_get_websafe_fonts();
	
	foreach ( $fonts as $font_name => $settings ) {
		
		$options[ $font_name ] = $font_name;
	}
	
	return $options;
}

if ( ! function_exists( 'testify_divi_include_categories_option' ) ) :

	function testify_divi_include_categories_option( $args = array() ) {
		
		$defaults = apply_filters( 'et_builder_include_categories_defaults', array (
			'use_terms' => true,
			'term_name' => 'project_category',
			'custom_msg_empty' => ''
		) );
		
		$args = wp_parse_args( $args, $defaults );
		
		$output = "\t" . "<% var et_pb_include_categories_temp = typeof et_pb_include_categories !== 'undefined' ? et_pb_include_categories.split( ',' ) : []; %>" . "\n";
		
		if ( $args['use_terms'] ) {
			$cats_array = get_terms( $args['term_name'] );
		} else {
			$cats_array = get_categories( apply_filters( 'et_builder_get_categories_args', 'hide_empty=0' ) );
		}
		
		if ( empty( $cats_array ) ) {
			
			if ( $args['custom_msg_empty'] != '' ) {
				
				$output = '<p>' . esc_html__( $args['custom_msg_empty'], 'testify-testify' ) . '</p>';
				
			} else {
				
				$output = '<p>' . esc_html__( 'You currently don\'t have any testimonials assigned to a category.', 'testify-testify' ) . '</p>';
			}
		}
		
		foreach ( $cats_array as $category ) {
			$contains = sprintf(
				'<%%= _.contains( et_pb_include_categories_temp, "%1$s" ) ? checked="checked" : "" %%>',
				esc_html( $category->term_id )
			);
			
			$output .= sprintf(
				'%4$s<label><input type="checkbox" name="et_pb_include_categories" value="%1$s"%3$s> %2$s</label><br/>',
				esc_attr( $category->term_id ),
				esc_html( $category->name ),
				$contains,
				"\n\t\t\t\t\t"
			);
		}
		
		$output = '<div id="et_pb_include_categories">' . $output . '</div>';
		
		return apply_filters( 'et_builder_include_categories_option_html', $output );
	}
	
endif;


function testify_get_qmark_styles( $active = null ) {
	
	$output  = _render_qmark_styles( $active );
	
	$output .= '<%= window.testify.render_qmark_styles() %>';
	
	$output = sprintf( '<div class="testify-qmark-container">%1$s</div>', $output );
	
	return $output;
}


function _render_qmark_styles( $active = null ) {
	
	$val = $active;
	
	$output = '<span class="testify-qmark-option' . ( empty( $val ) ? ' active' : '' ) . '" data-qmarkid="0">' . __('None', 'testify-testify') . '</span>';
	
	$qmarkId = 1;
	
	$qmarkFilePre = dirname(__FILE__) . '/../img/qmark';
	
	while( file_exists($qmarkFilePre . $qmarkId . '.svg') ) {
		$qmarkSvg = file_get_contents($qmarkFilePre . $qmarkId . '.svg');
		$output .= '<span class="testify-qmark-option' . ( $val == $qmarkId ? ' active' : '' ) . '" data-qmarkid="' . $qmarkId . '">'
				. str_replace('{color}', '#666', $qmarkSvg)
				. '</span>';
				
		++$qmarkId;
	}
	
	return $output;
}



Youez - 2016 - github.com/yon3zu
LinuXploit