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