Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/themify-.../plugin/classes
File: class-themify-builder-settings.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (!class_exists('Themify_Builder_Options',false)) :
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Class Builder Options
[5] Fix | Delete
*/
[6] Fix | Delete
class Themify_Builder_Options {
[7] Fix | Delete
[8] Fix | Delete
private const KEY = 'themify_builder_setting';
[9] Fix | Delete
private const SLUG = 'themify-builder';
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Constructor
[13] Fix | Delete
*/
[14] Fix | Delete
public static function init() {
[15] Fix | Delete
if (is_admin()) {
[16] Fix | Delete
add_action('admin_menu', array(__CLASS__, 'add_plugin_page'));
[17] Fix | Delete
add_action('wp_ajax_themify_builder_settings_save', array(__CLASS__, 'save'));
[18] Fix | Delete
} else {
[19] Fix | Delete
add_action('wp_head', array(__CLASS__, 'show_custom_css'));
[20] Fix | Delete
}
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
public static function add_plugin_page() {
[24] Fix | Delete
if (Themify_Access_Role::check_access_backend()) {
[25] Fix | Delete
$can_manage_option = current_user_can('manage_options');
[26] Fix | Delete
// This page will be under "Settings"
[27] Fix | Delete
$name = __('Themify Builder', 'themify');
[28] Fix | Delete
add_menu_page($name, $name, 'edit_posts', self::SLUG, $can_manage_option ? array(__CLASS__, 'create_admin_page') : '', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23ffcc08' viewBox='0 0 32 32'%3E%3Cpath d='M11.5 3.5c15.8-5 21.8 9 20.3 17.3-.9 4.5-10 5.7-18 6.5-6.9.7-12.1 2.3-12.1 2.3s6.2-4.7 2.1-6.8C1.4 21.6-6.6 9.1 11.5 3.5zm7.3 6c-1 0-1.9.8-1.9 1.8a2 2 0 0 0 2 1.9c1 0 1.8-.9 1.8-1.9 0-1-.8-1.9-1.9-1.9zm-9.4.9a1.9 1.9 0 0 0-1.9 1.9 2 2 0 0 0 2 1.8 2 2 0 0 0 1.8-1.8c0-1.1-.9-2-1.9-2zM7 17.8s7.7 9.8 18.2-1.8c0 0-12.1 7.2-18.2 1.8z'%3E%3C/path%3E%3C/svg%3E", 50);
[29] Fix | Delete
if ($can_manage_option) {
[30] Fix | Delete
add_submenu_page(self::SLUG, __('Settings', 'themify'), __('Settings', 'themify'), 'manage_options', self::SLUG);
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
add_submenu_page('themify-builder', __('Saved Layouts', 'themify'), __('Saved Layouts', 'themify'), 'edit_posts', 'edit.php?post_type=' . Themify_Builder_Layouts::LAYOUT_SLUG);
[34] Fix | Delete
add_submenu_page('themify-builder', __('Layout Parts', 'themify'), __('Layout Parts', 'themify'), 'edit_posts', 'edit.php?post_type=' . Themify_Builder_Layouts::LAYOUT_PART_SLUG);
[35] Fix | Delete
add_submenu_page('themify-builder', __('Global Styles', 'themify'), __('Global Styles', 'themify'), 'edit_posts', 'themify-global-styles', array(__CLASS__, 'global_styles_page'));
[36] Fix | Delete
add_submenu_page('themify-builder', __('Custom Fonts', 'themify'), __('Custom Fonts', 'themify'), 'edit_posts', 'edit.php?post_type=' . Themify_Custom_Fonts::SLUG);
[37] Fix | Delete
[38] Fix | Delete
if (!$can_manage_option) {
[39] Fix | Delete
remove_submenu_page(self::SLUG, self::SLUG);
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
public static function save() {
[45] Fix | Delete
check_ajax_referer('tf_nonce', 'nonce');
[46] Fix | Delete
if (current_user_can('manage_options') && Themify_Access_Role::check_access_backend()) {
[47] Fix | Delete
if (isset($_POST['data'])) {
[48] Fix | Delete
$data = stripslashes_deep($_POST['data']);
[49] Fix | Delete
} elseif (isset($_FILES['data'])) {
[50] Fix | Delete
$data = file_get_contents($_FILES['data']['tmp_name']);
[51] Fix | Delete
}
[52] Fix | Delete
if (isset($data)) {//don't use empty, when builder is empty need to remove data
[53] Fix | Delete
$results = array();
[54] Fix | Delete
$exist_data = get_option(self::KEY);
[55] Fix | Delete
$isExist = $exist_data !== false;
[56] Fix | Delete
if (empty($exist_data)) {
[57] Fix | Delete
$exist_data = array();
[58] Fix | Delete
}
[59] Fix | Delete
if (!empty($data)) {
[60] Fix | Delete
$data = json_decode($data, true);
[61] Fix | Delete
foreach ($data as $k => $v) {
[62] Fix | Delete
if ($v === '' || $v === 'default') {
[63] Fix | Delete
unset($data[$k]);
[64] Fix | Delete
}
[65] Fix | Delete
}
[66] Fix | Delete
$success = maybe_serialize($exist_data) === maybe_serialize($data) ? true : update_option(self::KEY, $data);
[67] Fix | Delete
} else {
[68] Fix | Delete
$success = $isExist === true ? delete_option(self::KEY) : true;
[69] Fix | Delete
$data = array();
[70] Fix | Delete
}
[71] Fix | Delete
if ($success === true) {
[72] Fix | Delete
Themify_Enqueue_Assets::rewrite_htaccess(empty($data['performance-cache_gzip']), empty($data['performance-webp']), empty($data['performance-cache_browser']));
[73] Fix | Delete
foreach (array('tablet_landscape', 'tablet', 'mobile') as $breakpoint) {
[74] Fix | Delete
if (isset($data["builder_responsive_design_{$breakpoint}"], $exist_data["builder_responsive_design_{$breakpoint}"]) && $data["builder_responsive_design_{$breakpoint}"] !== $exist_data["builder_responsive_design_{$breakpoint}"]) {
[75] Fix | Delete
Themify_Builder_Stylesheet::regenerate_css_files();
[76] Fix | Delete
break;
[77] Fix | Delete
}
[78] Fix | Delete
}
[79] Fix | Delete
}
[80] Fix | Delete
do_action( 'themify_builder_settings_save' );
[81] Fix | Delete
wp_send_json_success();
[82] Fix | Delete
}
[83] Fix | Delete
}
[84] Fix | Delete
wp_send_json_error();
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Display Builder Styles page content
[89] Fix | Delete
* @return String
[90] Fix | Delete
* @since 4.5.0
[91] Fix | Delete
*/
[92] Fix | Delete
public static function global_styles_page() {
[93] Fix | Delete
if (!current_user_can('edit_posts')) {
[94] Fix | Delete
wp_die(__('You do not have sufficient permissions to update this site.', 'themify'));
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
return Themify_Global_Styles::page_content();
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
private static function get_tab_settings():array {
[101] Fix | Delete
$modules=Themify_Builder_Component_Module::load_modules('all');
[102] Fix | Delete
$responsive = $disableModules = $feature_sizes = $disablePosts = array();
[103] Fix | Delete
$defBreakPoints = array(
[104] Fix | Delete
'tablet_landscape' => 1024,
[105] Fix | Delete
'tablet' => 768,
[106] Fix | Delete
'mobile' => 600
[107] Fix | Delete
);
[108] Fix | Delete
foreach (themify_get_breakpoints('', true) as $bp => $val) {
[109] Fix | Delete
$label = $bp === 'tablet_landscape' ? 'Tablet Landscape' : ($bp === 'tablet' ? 'Tablet Portrait' : ucfirst($bp));
[110] Fix | Delete
$responsive[] = array(
[111] Fix | Delete
'type' => 'slider',
[112] Fix | Delete
'id' => 'builder_responsive_design_' . $bp,
[113] Fix | Delete
'label' => sprintf(__('%s', 'themify'), $label),
[114] Fix | Delete
'def' => $defBreakPoints[$bp],
[115] Fix | Delete
'min' => is_array($val) ? $val[0] : 320,
[116] Fix | Delete
'max' => is_array($val) ? $val[1] : $val
[117] Fix | Delete
);
[118] Fix | Delete
}
[119] Fix | Delete
foreach ($modules as $k => $m) {
[120] Fix | Delete
$name= is_string($m)?$m::get_module_name():$m->get_name();
[121] Fix | Delete
$disableModules[] = array(
[122] Fix | Delete
'label' => sprintf(__('"%s" module', 'themify'), $name),
[123] Fix | Delete
'id' => 'builder_exclude_module_' . $k,
[124] Fix | Delete
'opp' => 1,
[125] Fix | Delete
'type' => 'toggle'
[126] Fix | Delete
);
[127] Fix | Delete
}
[128] Fix | Delete
foreach (themify_get_image_sizes_list() as $opt) {
[129] Fix | Delete
$feature_sizes[$opt['value']] = $opt['name'];
[130] Fix | Delete
}
[131] Fix | Delete
$excludes = array(Themify_Builder_Layouts::LAYOUT_PART_SLUG, Themify_Builder_Layouts::LAYOUT_SLUG, Themify_Global_Styles::SLUG, 'tbp_template');
[132] Fix | Delete
$globalGutters = Themify_Builder_Model::get_gutters();
[133] Fix | Delete
foreach (Themify_Builder::builder_post_types_support() as $v) {
[134] Fix | Delete
if (!in_array($v, $excludes, true)) {
[135] Fix | Delete
$disablePosts[] = array(
[136] Fix | Delete
'label' => sprintf(__('"%s" type', 'themify'), $v),
[137] Fix | Delete
'id' => 'builder_disable_tb_' . $v,
[138] Fix | Delete
'opp' => 1,
[139] Fix | Delete
'type' => 'toggle'
[140] Fix | Delete
);
[141] Fix | Delete
}
[142] Fix | Delete
}
[143] Fix | Delete
unset($excludes, $defBreakPoints);
[144] Fix | Delete
$imageLibrary = wp_image_editor_supports() !== false;
[145] Fix | Delete
return array(
[146] Fix | Delete
array(
[147] Fix | Delete
'type' => 'group',
[148] Fix | Delete
'label' => __('Column Gutter Size', 'themify'),
[149] Fix | Delete
'options' => array(
[150] Fix | Delete
array(
[151] Fix | Delete
'type' => 'number',
[152] Fix | Delete
'step' => .1,
[153] Fix | Delete
'id' => 'setting-gutter',
[154] Fix | Delete
'def' => $globalGutters['gutter'],
[155] Fix | Delete
'after' => __('Normal gutter (%)', 'themify')
[156] Fix | Delete
),
[157] Fix | Delete
array(
[158] Fix | Delete
'type' => 'number',
[159] Fix | Delete
'step' => .1,
[160] Fix | Delete
'id' => 'setting-narrow',
[161] Fix | Delete
'def' => $globalGutters['narrow'],
[162] Fix | Delete
'after' => __('Narrow gutter (%)', 'themify')
[163] Fix | Delete
),
[164] Fix | Delete
array(
[165] Fix | Delete
'type' => 'number',
[166] Fix | Delete
'step' => .1,
[167] Fix | Delete
'id' => 'setting-none',
[168] Fix | Delete
'def' => $globalGutters['none'],
[169] Fix | Delete
'after' => __('None gutter (%)', 'themify')
[170] Fix | Delete
),
[171] Fix | Delete
)
[172] Fix | Delete
),
[173] Fix | Delete
array(
[174] Fix | Delete
'label' => __('Gallery Module Lightbox', 'themify'),
[175] Fix | Delete
'type' => 'toggle',
[176] Fix | Delete
'id' => 'builder_lightbox',
[177] Fix | Delete
'value' => 'disable',
[178] Fix | Delete
'opp' => 1
[179] Fix | Delete
),
[180] Fix | Delete
array(
[181] Fix | Delete
'label' => __('Keyboard Shortcuts', 'themify'),
[182] Fix | Delete
'type' => 'toggle',
[183] Fix | Delete
'id' => 'builder_disable_shortcuts',
[184] Fix | Delete
'opp' => 1,
[185] Fix | Delete
'help' => __('Builder shortcuts (eg. disable shortcut like Cmd+S = save)', 'themify'),
[186] Fix | Delete
),
[187] Fix | Delete
array(
[188] Fix | Delete
'label' => __('WordPress Classic Editor', 'themify'),
[189] Fix | Delete
'type' => 'toggle',
[190] Fix | Delete
'id' => 'builder_disable_wp_editor',
[191] Fix | Delete
'opp' => 1,
[192] Fix | Delete
'help' => __('Enable/disable WordPress Classic Editor when Builder is in use', 'themify')
[193] Fix | Delete
),
[194] Fix | Delete
array(
[195] Fix | Delete
'label' => __('Google Fonts List', 'themify'),
[196] Fix | Delete
'type' => 'radio',
[197] Fix | Delete
'id' => 'builder_google_fonts',
[198] Fix | Delete
'def' => 'less',
[199] Fix | Delete
'options' => array(
[200] Fix | Delete
'less' => __('Show recommended Google Fonts only', 'themify'),
[201] Fix | Delete
'full' => __('Show all Google Fonts (showing all fonts will take longer to load)', 'themify'),
[202] Fix | Delete
)
[203] Fix | Delete
),
[204] Fix | Delete
array(
[205] Fix | Delete
'type' => 'group',
[206] Fix | Delete
'label' => __('Download Google Fonts', 'themify'),
[207] Fix | Delete
'options' => array(
[208] Fix | Delete
array(
[209] Fix | Delete
'type' => 'toggle',
[210] Fix | Delete
'id' => 'setting-gf',
[211] Fix | Delete
'desc' => __('Downloads all Google Fonts used in the Builder to your local server. Note: Google Maps, YouTube and any embeds loaded in iframe are excluded as they are loaded in the iframe.', 'themify'),
[212] Fix | Delete
),
[213] Fix | Delete
array(
[214] Fix | Delete
'type' => 'clear_cache',
[215] Fix | Delete
'action' => 'themify_clear_gfonts',
[216] Fix | Delete
'text' => __('Clear Google Fonts Cache', 'themify'),
[217] Fix | Delete
'clearing' => __('Clearing...', 'themify'),
[218] Fix | Delete
'done' => __('Done', 'themify')
[219] Fix | Delete
),
[220] Fix | Delete
)
[221] Fix | Delete
),
[222] Fix | Delete
array(
[223] Fix | Delete
'type' => 'group',
[224] Fix | Delete
'label' => __('Animation Effects', 'themify'),
[225] Fix | Delete
'options' => array(
[226] Fix | Delete
array(
[227] Fix | Delete
'label' => __('Appearance Animation', 'themify'),
[228] Fix | Delete
'type' => 'select',
[229] Fix | Delete
'id' => 'builder_animation_appearance',
[230] Fix | Delete
'options' => array(
[231] Fix | Delete
'' => '',
[232] Fix | Delete
'mobile' => __('Disable on mobile & tablet', 'themify'),
[233] Fix | Delete
'all' => __('Disable on all devices', 'themify')
[234] Fix | Delete
)
[235] Fix | Delete
),
[236] Fix | Delete
array(
[237] Fix | Delete
'label' => __('Parallax Background', 'themify'),
[238] Fix | Delete
'type' => 'select',
[239] Fix | Delete
'id' => 'builder_animation_parallax_bg',
[240] Fix | Delete
'options' => array(
[241] Fix | Delete
'' => '',
[242] Fix | Delete
'mobile' => __('Disable on mobile & tablet', 'themify'),
[243] Fix | Delete
'all' => __('Disable on all devices', 'themify')
[244] Fix | Delete
)
[245] Fix | Delete
),
[246] Fix | Delete
array(
[247] Fix | Delete
'label' => __('Scroll Effects', 'themify'),
[248] Fix | Delete
'type' => 'select',
[249] Fix | Delete
'id' => 'builder_animation_scroll_effect',
[250] Fix | Delete
'options' => array(
[251] Fix | Delete
'' => '',
[252] Fix | Delete
'mobile' => __('Disable on mobile & tablet', 'themify'),
[253] Fix | Delete
'all' => __('Disable on all devices', 'themify')
[254] Fix | Delete
)
[255] Fix | Delete
),
[256] Fix | Delete
)
[257] Fix | Delete
),
[258] Fix | Delete
array(
[259] Fix | Delete
'type' => 'group',
[260] Fix | Delete
'label' => __('Responsive Breakpoints', 'themify'),
[261] Fix | Delete
'options' => $responsive
[262] Fix | Delete
),
[263] Fix | Delete
array(
[264] Fix | Delete
'type' => 'number',
[265] Fix | Delete
'id' => 'builder_scrollTo',
[266] Fix | Delete
'label' => __('ScrollTo Offset', 'themify'),
[267] Fix | Delete
'after' => 'px',
[268] Fix | Delete
'help' => __('Enter the top position where it should scrollTo', 'themify')
[269] Fix | Delete
),
[270] Fix | Delete
array(
[271] Fix | Delete
'type' => 'number',
[272] Fix | Delete
'id' => 'builder_scrollTo_speed',
[273] Fix | Delete
'label' => __('ScrollTo Speed', 'themify'),
[274] Fix | Delete
'after' => 'Seconds',
[275] Fix | Delete
'step' => .1,
[276] Fix | Delete
'help' => __('Speed of scrolling animation. Default: 0.9 second', 'themify')
[277] Fix | Delete
),
[278] Fix | Delete
array(
[279] Fix | Delete
'label' => __('Image Script', 'themify'),
[280] Fix | Delete
'type' => 'toggle',
[281] Fix | Delete
'id' => 'image_setting-img_settings_use',
[282] Fix | Delete
'opp' => 1,
[283] Fix | Delete
'help' => __('Image script crops the images to the entered size. If disabled, WordPress Featured Image or original images will be used.', 'themify'),
[284] Fix | Delete
'disabled' => $imageLibrary ? '' : sprintf(__('This feature requires an <a href="%s" target="_blank">image processing library</a> to be installed on the server. Please contact your hosting provider to enable this.', 'themify'), 'https://www.php.net/manual/en/refs.utilspec.image.php'),
[285] Fix | Delete
'bind' => array(
[286] Fix | Delete
'checked' => array(
[287] Fix | Delete
'show' => 'featured_size'
[288] Fix | Delete
),
[289] Fix | Delete
'not_checked' => array(
[290] Fix | Delete
'hide' => 'featured_size'
[291] Fix | Delete
)
[292] Fix | Delete
)
[293] Fix | Delete
),
[294] Fix | Delete
array(
[295] Fix | Delete
'label' => __('Default Featured Image Size', 'themify'),
[296] Fix | Delete
'type' => 'select',
[297] Fix | Delete
'wrap_class' => $imageLibrary ? 'featured_size' : '',
[298] Fix | Delete
'id' => 'image_global_size_field',
[299] Fix | Delete
'options' => $feature_sizes
[300] Fix | Delete
),
[301] Fix | Delete
array(
[302] Fix | Delete
'label' => __('Builder For Post Types', 'themify'),
[303] Fix | Delete
'type' => 'group',
[304] Fix | Delete
'options' => $disablePosts
[305] Fix | Delete
),
[306] Fix | Delete
array(
[307] Fix | Delete
'label' => __('Builder Modules', 'themify'),
[308] Fix | Delete
'type' => 'group',
[309] Fix | Delete
'options' => $disableModules
[310] Fix | Delete
)
[311] Fix | Delete
);
[312] Fix | Delete
}
[313] Fix | Delete
[314] Fix | Delete
private static function get_tab_performance():array {
[315] Fix | Delete
$htaccess_file = Themify_Enqueue_Assets::getHtaccessFile();
[316] Fix | Delete
$htaccess_msg = Themify_Filesystem::is_file($htaccess_file) && Themify_Filesystem::is_writable($htaccess_file) ? '' : sprintf(__('The htaccess file %s isn`t writable. Please allow to write to enable this feauture', 'themify'), $htaccess_file);
[317] Fix | Delete
$imageLibrary = wp_image_editor_supports() !== false;
[318] Fix | Delete
return array(
[319] Fix | Delete
array(
[320] Fix | Delete
'type' => 'group',
[321] Fix | Delete
'label' => __('Lazy Load', 'themify'),
[322] Fix | Delete
'options' => array(
[323] Fix | Delete
array(
[324] Fix | Delete
'label' => __('Themify Lazy Load', 'themify'),
[325] Fix | Delete
'type' => 'toggle',
[326] Fix | Delete
'id' => 'performance-disable-lazy',
[327] Fix | Delete
'opp' => 1
[328] Fix | Delete
)
[329] Fix | Delete
)
[330] Fix | Delete
),
[331] Fix | Delete
array(
[332] Fix | Delete
'label' => __('Browser Caching', 'themify'),
[333] Fix | Delete
'type' => 'toggle',
[334] Fix | Delete
'help' => __("Cache static assets (CSS, JS, images, etc.) on user's browser. HTML is not cached", 'themify'),
[335] Fix | Delete
'disabled' => $htaccess_msg,
[336] Fix | Delete
'id' => 'performance-cache_browser',
[337] Fix | Delete
),
[338] Fix | Delete
array(
[339] Fix | Delete
'label' => __('Gzip Scripts', 'themify'),
[340] Fix | Delete
'type' => 'toggle',
[341] Fix | Delete
'id' => 'performance-cache_gzip',
[342] Fix | Delete
'disabled' => $htaccess_msg,
[343] Fix | Delete
'desc' => $htaccess_msg === '' ? sprintf(__('Enabling Gzip will add code to your .htaccess file %s', 'themify'), $htaccess_file) : '',
[344] Fix | Delete
),
[345] Fix | Delete
array(
[346] Fix | Delete
'label' => __('Enable jQuery Migrate', 'themify'),
[347] Fix | Delete
'type' => 'toggle',
[348] Fix | Delete
'id' => 'performance-jquery_migrate',
[349] Fix | Delete
'help' => __('Enable this option if you have plugins that use deprecated jQuery versions.', 'themify')
[350] Fix | Delete
),
[351] Fix | Delete
array(
[352] Fix | Delete
'label' => __('WebP Images', 'themify'),
[353] Fix | Delete
'type' => 'toggle',
[354] Fix | Delete
'id' => 'performance-webp',
[355] Fix | Delete
'help' => __('Enable WebP image (recommended)', 'themify'),
[356] Fix | Delete
'disabled' => $imageLibrary ? '' : __('The GD library or Imagick extensions are not installed. Ask your host provider to enable them to use this feature.', 'themify'),
[357] Fix | Delete
'bind' => array(
[358] Fix | Delete
'checked' => array(
[359] Fix | Delete
'show' => 'webp_group'
[360] Fix | Delete
),
[361] Fix | Delete
'not_checked' => array(
[362] Fix | Delete
'hide' => 'webp_group'
[363] Fix | Delete
)
[364] Fix | Delete
)
[365] Fix | Delete
),
[366] Fix | Delete
array(
[367] Fix | Delete
'type' => 'group',
[368] Fix | Delete
'label' => __('WebP Image Quality', 'themify'),
[369] Fix | Delete
'help' => __('Lower quality has smaller file size, but image might appear pixelated/blurry.', 'themify'),
[370] Fix | Delete
'wrap_class' => 'webp_group',
[371] Fix | Delete
'options' => array(
[372] Fix | Delete
array(
[373] Fix | Delete
'type' => 'select',
[374] Fix | Delete
'disabled' => $imageLibrary ? '' : 'disable',
[375] Fix | Delete
'id' => 'performance-webp_quality',
[376] Fix | Delete
'def' => '5',
[377] Fix | Delete
'options' => array(
[378] Fix | Delete
'1' => __('Lowest', 'themify'),
[379] Fix | Delete
'2' => __('Low', 'themify'),
[380] Fix | Delete
'3' => __('Medium', 'themify'),
[381] Fix | Delete
'4' => __('Good', 'themify'),
[382] Fix | Delete
'5' => __('High', 'themify'),
[383] Fix | Delete
'6' => __('Highest', 'themify'),
[384] Fix | Delete
)
[385] Fix | Delete
),
[386] Fix | Delete
array(
[387] Fix | Delete
'type' => 'clear_cache',
[388] Fix | Delete
'disabled' => $imageLibrary ? '' : 'disable',
[389] Fix | Delete
'action' => 'themify_clear_all_webp',
[390] Fix | Delete
'text' => __('Clear WebP Images', 'themify'),
[391] Fix | Delete
'clearing' => __('Clearing...', 'themify'),
[392] Fix | Delete
'done' => __('Done', 'themify')
[393] Fix | Delete
),
[394] Fix | Delete
)
[395] Fix | Delete
),
[396] Fix | Delete
array(
[397] Fix | Delete
'label' => __('Concate CSS', 'themify'),
[398] Fix | Delete
'type' => 'clear_cache',
[399] Fix | Delete
'action' => 'themify_clear_all_concate',
[400] Fix | Delete
'text' => __('Clear Concate CSS Cache', 'themify'),
[401] Fix | Delete
'clearing' => __('Clearing...', 'themify'),
[402] Fix | Delete
'done' => __('Done', 'themify'),
[403] Fix | Delete
'disabled' => Themify_Enqueue_Assets::createDir() ? '' : __('It looks like the WordPress upload folder path is set wrong or have file permission issue. Please check the upload path on WP Settings > Media. Make sure the folder is set correctly and it has correct file permission.', 'themify'),
[404] Fix | Delete
'network' => is_multisite() ? array('tmp_cache_concte_network' => __('Clear Concate cache in the whole network site', 'themify')) : '',
[405] Fix | Delete
),
[406] Fix | Delete
);
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
private static function get_tab_role_access():array {
[410] Fix | Delete
global $wp_roles;
[411] Fix | Delete
$defaultRoles = array(
[412] Fix | Delete
'backend' => __('Builder Backend Access', 'themify'),
[413] Fix | Delete
'frontend' => __('Builder Frontend Access', 'themify')
[414] Fix | Delete
);
[415] Fix | Delete
$role_options = array(
[416] Fix | Delete
'default' => __('Default', 'themify'),
[417] Fix | Delete
'enable' => __('Enable', 'themify'),
[418] Fix | Delete
'disable' => __('Disable', 'themify')
[419] Fix | Delete
);
[420] Fix | Delete
$result = array();
[421] Fix | Delete
$roles = $wp_roles->get_names();
[422] Fix | Delete
$defaultRoles = apply_filters('tb_roles', $defaultRoles);
[423] Fix | Delete
// Remove the adminitrator and subscriber user role from the array
[424] Fix | Delete
unset($roles['administrator']);
[425] Fix | Delete
[426] Fix | Delete
// Remove all the user roles with no "edit_posts" capability
[427] Fix | Delete
foreach ($roles as $role => $slug) {
[428] Fix | Delete
if (empty($wp_roles->roles[$role]['capabilities']['edit_posts'])) {
[429] Fix | Delete
unset($roles[$role]);
[430] Fix | Delete
}
[431] Fix | Delete
}
[432] Fix | Delete
[433] Fix | Delete
foreach ($defaultRoles as $k => $v) {
[434] Fix | Delete
$opt = array();
[435] Fix | Delete
foreach ($roles as $type => $name) {
[436] Fix | Delete
$opt[] = array(
[437] Fix | Delete
'type' => 'select',
[438] Fix | Delete
'label' => $name,
[439] Fix | Delete
'id' => 'setting-' . $k . '-' . $type,
[440] Fix | Delete
'options' => $k === 'tbp' ? array_merge( $role_options, [ 'enableown' => __( 'Enable For Owned Posts', 'themify' ) ] ) : $role_options
[441] Fix | Delete
);
[442] Fix | Delete
}
[443] Fix | Delete
$result[] = array(
[444] Fix | Delete
'type' => 'group',
[445] Fix | Delete
'label' => $v,
[446] Fix | Delete
'options' => $opt
[447] Fix | Delete
);
[448] Fix | Delete
}
[449] Fix | Delete
return $result;
[450] Fix | Delete
}
[451] Fix | Delete
[452] Fix | Delete
private static function get_tab_custom_css():array {
[453] Fix | Delete
return array(
[454] Fix | Delete
array(
[455] Fix | Delete
'label' => __('Custom CSS', 'themify'),
[456] Fix | Delete
'id' => 'custom_css-custom_css',
[457] Fix | Delete
'type' => 'textarea',
[458] Fix | Delete
'codeditor' => 'css'
[459] Fix | Delete
)
[460] Fix | Delete
);
[461] Fix | Delete
}
[462] Fix | Delete
[463] Fix | Delete
private static function get_tab_integration():array {
[464] Fix | Delete
[465] Fix | Delete
include_once THEMIFY_BUILDER_INCLUDES_DIR . '/optin-services/base.php';
[466] Fix | Delete
$providers = Builder_Optin_Service::get_providers('all',true);
[467] Fix | Delete
$optins = array();
[468] Fix | Delete
foreach ($providers as $id => $provider) {
[469] Fix | Delete
$options = $provider::get_global_options();
[470] Fix | Delete
if (!empty($options)) {
[471] Fix | Delete
foreach ($options as &$opt) {
[472] Fix | Delete
if (isset($opt['description'])) {
[473] Fix | Delete
$opt['desc'] = $opt['description'];
[474] Fix | Delete
unset($opt['description']);
[475] Fix | Delete
}
[476] Fix | Delete
$optins[] = $opt;
[477] Fix | Delete
}
[478] Fix | Delete
}
[479] Fix | Delete
}
[480] Fix | Delete
$optins[] = array(
[481] Fix | Delete
'type' => 'clear_cache',
[482] Fix | Delete
'action' => 'tb_optin_clear_cache',
[483] Fix | Delete
'text' => __('Clear Cache', 'themify'),
[484] Fix | Delete
'clearing' => __('Clearing...', 'themify'),
[485] Fix | Delete
'done' => __('Done', 'themify'),
[486] Fix | Delete
);
[487] Fix | Delete
return array(
[488] Fix | Delete
array(
[489] Fix | Delete
'label' => __('Google Map API Key', 'themify'),
[490] Fix | Delete
'type' => 'text',
[491] Fix | Delete
'id' => 'builder_settings_google_map_key',
[492] Fix | Delete
'desc' => sprintf(__('Google API key is required to use Builder Map module and Map shortcode. <a href="%s" target="_blank">Generate an API key</a> and insert it here. Also, please ensure you\'ve setup a <a href="%s" target="_blank">billing plan</a>.'), '//developers.google.com/maps/documentation/javascript/get-api-key#key', 'https://support.google.com/googleapi/answer/6158867')
[493] Fix | Delete
),
[494] Fix | Delete
array(
[495] Fix | Delete
'label' => __('Bing Map API Key', 'themify'),
[496] Fix | Delete
'type' => 'text',
[497] Fix | Delete
'id' => 'builder_settings_bing_map_key',
[498] Fix | Delete
'desc' => sprintf(__('To use Bing Maps, <a href="%s" target="_blank">generate an API key</a> and insert it here.', 'themify'), 'https://msdn.microsoft.com/en-us/library/ff428642.aspx')
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function