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.../public_h.../wp-conte.../plugins/themify-.../themify
File: class-themify-enqueue.php
<?php
[0] Fix | Delete
if (!defined('ABSPATH'))
[1] Fix | Delete
exit; // Exit if accessed directly
[2] Fix | Delete
/**
[3] Fix | Delete
* The file that defines css/js loading class and concate css files
[4] Fix | Delete
* @package Themify
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
class Themify_Enqueue_Assets {
[8] Fix | Delete
[9] Fix | Delete
public const THEMIFY_CSS_MODULES_URI=THEMIFY_URI . '/css/modules/';
[10] Fix | Delete
[11] Fix | Delete
private static $wc_shortcode_type = array();
[12] Fix | Delete
private static $wc_data = array();
[13] Fix | Delete
private static $css = array('mobile_concate' => array());
[14] Fix | Delete
private static $done = array();
[15] Fix | Delete
private static $localiztion = array();
[16] Fix | Delete
private static $theme_css_support = array('mobile-menu'=>true,'rtl'=>true);
[17] Fix | Delete
private static $concateFile = null;
[18] Fix | Delete
private static $googleFonts = array();
[19] Fix | Delete
private static $guttenbergCss = array();
[20] Fix | Delete
public static $preLoadMedia = array();
[21] Fix | Delete
public static $disableGoogleFontsLoad = null;
[22] Fix | Delete
public static $isHeader = false;
[23] Fix | Delete
public static $isFooter = false;
[24] Fix | Delete
public static $mediaMaxWidth = 1200;
[25] Fix | Delete
public static $mobileMenuActive = 1100;
[26] Fix | Delete
[27] Fix | Delete
public static $THEME_CSS_MODULES_URI = null;
[28] Fix | Delete
public static $THEME_CSS_MODULES_DIR = null;
[29] Fix | Delete
public static $THEME_WC_CSS_MODULES_DIR = null;
[30] Fix | Delete
public static $THEME_WC_CSS_MODULES_URI = null;
[31] Fix | Delete
public static $themeVersion = null;
[32] Fix | Delete
[33] Fix | Delete
public static function init() {
[34] Fix | Delete
if (themify_is_themify_theme()) {
[35] Fix | Delete
self::$THEME_CSS_MODULES_DIR = THEME_DIR . '/styles/modules/';
[36] Fix | Delete
self::$THEME_CSS_MODULES_URI = THEME_URI . '/styles/modules/';
[37] Fix | Delete
[38] Fix | Delete
self::$THEME_WC_CSS_MODULES_DIR = THEME_DIR . '/styles/wc/modules/';
[39] Fix | Delete
self::$THEME_WC_CSS_MODULES_URI = THEME_URI . '/styles/wc/modules/';
[40] Fix | Delete
[41] Fix | Delete
self::$themeVersion = wp_get_theme(get_template())->display('Version');
[42] Fix | Delete
self::$mobileMenuActive = (int) themify_get('setting-mobile_menu_trigger_point', self::$mobileMenuActive, true);
[43] Fix | Delete
}
[44] Fix | Delete
if (!is_admin()) {
[45] Fix | Delete
add_action('wp_body_open', array(__CLASS__, 'body_open'), 1);
[46] Fix | Delete
add_filter('wp_default_scripts', array(__CLASS__, 'remove_default_js'));
[47] Fix | Delete
add_action('wp', array(__CLASS__, 'lazy_init'), 1);
[48] Fix | Delete
} else {
[49] Fix | Delete
add_action('wp_loaded', array(__CLASS__, 'lazy_init'), 1);
[50] Fix | Delete
add_action('admin_init', array(__CLASS__, 'loadMainScript'));
[51] Fix | Delete
add_action('admin_footer', array(__CLASS__, 'js_localize'), 18);
[52] Fix | Delete
}
[53] Fix | Delete
add_filter('themify_loops_wrapper_class', array(__CLASS__, 'load_loop_css'), 100, 6);
[54] Fix | Delete
add_filter('kses_allowed_protocols', array(__CLASS__, 'allow_lazy_protocols'), 100, 1);
[55] Fix | Delete
add_filter('sgo_js_minify_exclude', array(__CLASS__,'exclude_main_js' ),1);
[56] Fix | Delete
add_filter('sgo_javascript_combine_exclude', array( __CLASS__, 'exclude_main_js' ),1 );
[57] Fix | Delete
add_filter('autoptimize_filter_js_exclude', array(__CLASS__,'exclude_main_js' ),1);
[58] Fix | Delete
add_filter('autoptimize_filter_js_consider_minified',array(__CLASS__,'exclude_main_js' ),1);
[59] Fix | Delete
add_filter('rocket_delay_js_exclusions', array( __CLASS__, 'exclude_main_js' ),1 );
[60] Fix | Delete
add_filter('rocket_exclude_js',array( __CLASS__, 'exclude_main_js' ),1 );
[61] Fix | Delete
add_filter( 'js_do_concat', [ __CLASS__, 'Automattic_page_optimize_js_exclude' ], 10, 2 );
[62] Fix | Delete
add_action('pre_get_search_form', array(__CLASS__, 'load_search_form_css'), 9);
[63] Fix | Delete
if (!is_admin() || themify_is_ajax()) {
[64] Fix | Delete
add_filter('post_playlist', array(__CLASS__, 'wp_media_playlist'), 100, 3);
[65] Fix | Delete
}
[66] Fix | Delete
add_filter('cron_schedules', array(__CLASS__, 'cron_schedules'));
[67] Fix | Delete
add_action('themify_cron_clear_css', array(__CLASS__, 'cron'));
[68] Fix | Delete
if (!wp_next_scheduled('themify_cron_clear_css')) {
[69] Fix | Delete
wp_schedule_event(time() + WEEK_IN_SECONDS * 4, 'four_week', 'themify_cron_clear_css');
[70] Fix | Delete
}
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
public static function lazy_init() {
[74] Fix | Delete
if (!is_admin() && !themify_is_login_page()) {
[75] Fix | Delete
remove_action('wp_head', 'wp_resource_hints', 2);
[76] Fix | Delete
if (self::$themeVersion !== null) {
[77] Fix | Delete
add_action('wp_head', array(__CLASS__, 'header_meta'),-1111);
[78] Fix | Delete
add_action('wp_head', array(__CLASS__, 'header_html'));
[79] Fix | Delete
add_filter('wp_title', array(__CLASS__, 'wp_title'), 10, 2);
[80] Fix | Delete
remove_action('wp_head', 'locale_stylesheet'); //remove rtl loading
[81] Fix | Delete
}
[82] Fix | Delete
add_action( 'template_redirect', array( __CLASS__, 'start_buffer' ) );
[83] Fix | Delete
add_action('wp_enqueue_scripts', array(__CLASS__, 'before_enqueue'), 7);
[84] Fix | Delete
add_action('wp_enqueue_scripts', array(__CLASS__, 'after_enqueue'), 11);
[85] Fix | Delete
add_filter('style_loader_tag', array(__CLASS__, 'style_header_tag'), 10, 4);
[86] Fix | Delete
add_filter('render_block_data', array(__CLASS__, 'loadGuttenbergCss'), PHP_INT_MAX, 2);
[87] Fix | Delete
add_action('wp_head', array(__CLASS__, 'css_position'),100);
[88] Fix | Delete
add_action('wp_head', array(__CLASS__, 'wp_head'),-100);
[89] Fix | Delete
add_action('wp_footer', array(__CLASS__, 'before_footer'), -1111);
[90] Fix | Delete
add_action('wp_footer', array(__CLASS__, 'js_localize'), 18);
[91] Fix | Delete
add_action('wp_footer', array(__CLASS__, 'wp_footer'), 100);
[92] Fix | Delete
}
[93] Fix | Delete
elseif(is_admin()){
[94] Fix | Delete
add_action('admin_head', array(__CLASS__, 'dev_mode_styles'));
[95] Fix | Delete
}
[96] Fix | Delete
if(!is_admin() || themify_is_ajax()){
[97] Fix | Delete
add_filter('widget_display_callback', array(__CLASS__, 'widget_css'), 100, 3);
[98] Fix | Delete
add_action('wp_playlist_scripts',array(__CLASS__,'disable_playlist_template'),0,1);
[99] Fix | Delete
}
[100] Fix | Delete
add_filter('wp_audio_shortcode_library', array(__CLASS__, 'media_shortcode_library'), 100, 1);
[101] Fix | Delete
add_filter('wp_video_shortcode_library', array(__CLASS__, 'media_shortcode_library'), 10, 1);
[102] Fix | Delete
add_filter('wp_audio_shortcode', array(__CLASS__, 'audio_shortcode'), 100, 5);
[103] Fix | Delete
add_filter('wp_video_shortcode_override', array(__CLASS__, 'video_shortcode'), 100, 4);
[104] Fix | Delete
add_filter('embed_oembed_html',array(__CLASS__,'embed'),100,4);
[105] Fix | Delete
if (themify_is_lazyloading()) {
[106] Fix | Delete
themify_disable_other_lazy();
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
$cdn=' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com *.lottiefiles.com';
[110] Fix | Delete
themify_set_headers(array(
[111] Fix | Delete
'CONTENT-SECURITY-POLICY'=>array(
[112] Fix | Delete
'img-src'=>'data:',
[113] Fix | Delete
'style-src'=>"'unsafe-inline'".$cdn,
[114] Fix | Delete
'style-src-elem'=>"'unsafe-inline'".$cdn,
[115] Fix | Delete
'script-src'=>"'unsafe-inline' data:".$cdn,
[116] Fix | Delete
'script-src-elem'=>"'unsafe-inline' data:".$cdn,
[117] Fix | Delete
'connect-src'=>'https://themify.org *.lottiefiles.com',
[118] Fix | Delete
'default-src'=>'https://themify.org data:'.$cdn
[119] Fix | Delete
)
[120] Fix | Delete
));
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
public static function start_buffer(){
[124] Fix | Delete
self::createDir();
[125] Fix | Delete
ob_start(array(__CLASS__, 'getBuffer'));
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
public static function createDir():bool {
[129] Fix | Delete
if (self::$concateFile === null) {
[130] Fix | Delete
self::$concateFile = self::getCurrentVersionFolder();
[131] Fix | Delete
if (!is_dir(self::$concateFile)) {
[132] Fix | Delete
Themify_Filesystem::mkdir(self::$concateFile,true);
[133] Fix | Delete
if (!Themify_Filesystem::is_dir(self::$concateFile)) {
[134] Fix | Delete
clearstatcache();
[135] Fix | Delete
Themify_Filesystem::mkdir(self::$concateFile,true);
[136] Fix | Delete
if (!Themify_Filesystem::is_dir(self::$concateFile)) {
[137] Fix | Delete
self::$concateFile = null;
[138] Fix | Delete
return false;
[139] Fix | Delete
}
[140] Fix | Delete
}
[141] Fix | Delete
}
[142] Fix | Delete
}
[143] Fix | Delete
return true;
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
public static function remove_default_js($scripts) {
[147] Fix | Delete
if (!themify_builder_check('setting-jquery-migrate', 'performance-jquery_migrate') && !themify_is_login_page()) {
[148] Fix | Delete
$script = $scripts->registered['jquery'];
[149] Fix | Delete
if (!empty($script->deps)) { // Check whether the script has any dependencies
[150] Fix | Delete
$key = 'jquery-migrate';
[151] Fix | Delete
$index = isset($script->deps[1]) && $script->deps[1] === $key ? 1 : array_search($key, $script->deps, true);
[152] Fix | Delete
if ($index !== false) {
[153] Fix | Delete
unset($script->deps[$index]);
[154] Fix | Delete
}
[155] Fix | Delete
}
[156] Fix | Delete
}
[157] Fix | Delete
return $scripts;
[158] Fix | Delete
}
[159] Fix | Delete
[160] Fix | Delete
public static function before_enqueue() {
[161] Fix | Delete
self::add_css('tf_base', THEMIFY_URI . '/css/base.min.css', null, THEMIFY_VERSION);
[162] Fix | Delete
if (self::$themeVersion !== null) {
[163] Fix | Delete
self::add_css('themify_common', THEMIFY_URI . '/css/themify-common.css', null, THEMIFY_VERSION);
[164] Fix | Delete
if(is_admin_bar_showing()){
[165] Fix | Delete
self::add_css('themify_common_logged', THEMIFY_URI . '/css/themify-common-logged.css', null, THEMIFY_VERSION,'',true);
[166] Fix | Delete
}
[167] Fix | Delete
}
[168] Fix | Delete
self::loadMainScript();
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
public static function after_enqueue() {
[172] Fix | Delete
global $wp_styles, $wp_version;
[173] Fix | Delete
$css = array('wp-block-library');
[174] Fix | Delete
$is_theme = self::$themeVersion !== null;
[175] Fix | Delete
if ($is_theme === true && themify_is_woocommerce_active()) {
[176] Fix | Delete
add_filter('woocommerce_shortcode_products_query', array(__CLASS__, 'wc_shortcode_product'), 10, 3);
[177] Fix | Delete
add_action('woocommerce_before_single_product_summary', array(__CLASS__, 'wc_shortcode_product_page'));
[178] Fix | Delete
add_action('woocommerce_before_checkout_form_cart_notices', array(__CLASS__, 'wc_shortcode_checkout'));
[179] Fix | Delete
add_action('woocommerce_account_content', array(__CLASS__, 'wc_shortcode_account'));
[180] Fix | Delete
$wc_ver = WC()->version;
[181] Fix | Delete
self::$localiztion['wc_version'] = $wc_ver;
[182] Fix | Delete
wp_enqueue_script('wc-cart-fragments');//default load has been removed from wc 7.8.0
[183] Fix | Delete
if (themify_is_shop() || is_product() || (!is_checkout() && !is_account_page() && !is_checkout_pay_page() && !is_edit_account_page() && !is_order_received_page() && !is_add_payment_method_page())) {
[184] Fix | Delete
wp_enqueue_script('wc-add-to-cart-variation'); //load tmpl files
[185] Fix | Delete
wp_enqueue_script('wc-single-product');
[186] Fix | Delete
wp_enqueue_script('jquery-blockui');
[187] Fix | Delete
WC_Frontend_Scripts::localize_printed_scripts();
[188] Fix | Delete
global $wp_scripts;
[189] Fix | Delete
$js = array('js-cookie', 'wc-add-to-cart', 'wc-add-to-cart-variation', 'wc-cart-fragments', 'woocommerce', 'wc_additional_variation_images_script', 'wc-single-product');
[190] Fix | Delete
$arr = array();
[191] Fix | Delete
$disableOptimize = themify_check('setting-optimize-wc', true);
[192] Fix | Delete
$isDefered=themify_check('setting-jquery', true)?true:($disableOptimize?false:!themify_check('setting-defer-wc', true));
[193] Fix | Delete
foreach ($js as $v) {
[194] Fix | Delete
if (isset($wp_scripts->registered[$v]) && wp_script_is($v)) {
[195] Fix | Delete
if ($isDefered === true && !empty($wp_scripts->registered[$v]->extra['data'])) {
[196] Fix | Delete
self::$wc_data[] = $wp_scripts->registered[$v]->extra['data'];
[197] Fix | Delete
$wp_scripts->registered[$v]->extra['data']='';
[198] Fix | Delete
}
[199] Fix | Delete
if ($v === 'wc-single-product' && is_product()) {
[200] Fix | Delete
continue;
[201] Fix | Delete
}
[202] Fix | Delete
if ($disableOptimize === false) {
[203] Fix | Delete
$wp_scripts->done[] = $v;
[204] Fix | Delete
}
[205] Fix | Delete
$arr[$v] = $wp_scripts->registered[$v]->src;
[206] Fix | Delete
if ($wc_ver !== $wp_scripts->registered[$v]->ver) {
[207] Fix | Delete
$arr[$v] .= '?ver=' . $wp_scripts->registered[$v]->ver;
[208] Fix | Delete
}
[209] Fix | Delete
}
[210] Fix | Delete
}
[211] Fix | Delete
self::$localiztion['wc_js'] = $arr;
[212] Fix | Delete
if ($disableOptimize === true) {
[213] Fix | Delete
self::$localiztion['wc_js_normal'] = true;
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
// Localize photoswipe css
[217] Fix | Delete
if (!empty($wp_styles->registered['photoswipe']->src)) {
[218] Fix | Delete
wp_dequeue_style('photoswipe');
[219] Fix | Delete
wp_dequeue_style('photoswipe-default-skin');
[220] Fix | Delete
self::$localiztion['photoswipe'] = array('main' => $wp_styles->registered['photoswipe']->src, 'skin' => $wp_styles->registered['photoswipe-default-skin']->src);
[221] Fix | Delete
}
[222] Fix | Delete
$js = $arr = null;
[223] Fix | Delete
}
[224] Fix | Delete
$wc_block_prefix = 'wc-block';
[225] Fix | Delete
if (intval($wc_ver[0]) >= 6) {
[226] Fix | Delete
$wc_block_prefix .= 's';
[227] Fix | Delete
}
[228] Fix | Delete
$css[] = $wc_block_prefix . '-vendors-style';
[229] Fix | Delete
$css[] = $wc_block_prefix . '-style';
[230] Fix | Delete
$css[] = 'wp-block-library-theme';
[231] Fix | Delete
$css[] = 'woocommerce-layout';
[232] Fix | Delete
$css[] = 'woocommerce-smallscreen';
[233] Fix | Delete
$css[] = 'woocommerce-general';
[234] Fix | Delete
$css[] = 'select2';
[235] Fix | Delete
$css[]='woocommerce-blocktheme';
[236] Fix | Delete
$css[] = 'woocommerce_prettyPhoto_css';
[237] Fix | Delete
}
[238] Fix | Delete
$css = apply_filters('themify_deq_css', $css);
[239] Fix | Delete
foreach ($css as $v) {
[240] Fix | Delete
if (isset($wp_styles->registered[$v]) && wp_style_is($v)) {
[241] Fix | Delete
$src = $wp_styles->registered[$v]->src;
[242] Fix | Delete
if ($v === 'wp-block-library' || $v === 'wp-block-library-theme' || $v === $wc_block_prefix . '-style' || $v === $wc_block_prefix . '-vendors-style') {
[243] Fix | Delete
if (empty($wp_styles->registered[$v]->deps) || ($v === $wc_block_prefix . '-style' && count($wp_styles->registered[$v]->deps) === 1 && $wp_styles->registered[$v]->deps[0] === $wc_block_prefix . '-vendors-style')) {
[244] Fix | Delete
$wp_styles->done[] = $v;
[245] Fix | Delete
self::$guttenbergCss[$v] = $src;
[246] Fix | Delete
}
[247] Fix | Delete
continue;
[248] Fix | Delete
}
[249] Fix | Delete
$wp_styles->done[] = $v;
[250] Fix | Delete
$ver = $wp_styles->registered[$v]->ver;
[251] Fix | Delete
if ($src[0] === '/' && $src[1] === '/') {
[252] Fix | Delete
$src = (is_ssl() ? 'https:' : 'http:') . $src;
[253] Fix | Delete
}
[254] Fix | Delete
if (strpos($src, 'http') === false) {
[255] Fix | Delete
$src = home_url($src);
[256] Fix | Delete
}
[257] Fix | Delete
if (empty($ver)) {
[258] Fix | Delete
$ver = $wp_version;
[259] Fix | Delete
}
[260] Fix | Delete
wp_dequeue_style($v);
[261] Fix | Delete
self::add_css($v, $src, $wp_styles->registered[$v]->deps, $ver, $wp_styles->registered[$v]->args);
[262] Fix | Delete
}
[263] Fix | Delete
}
[264] Fix | Delete
$css = null;
[265] Fix | Delete
if ($is_theme === true) {
[266] Fix | Delete
if (isset(self::$theme_css_support['mobile-menu'])) {
[267] Fix | Delete
self::addMobileMenuCss('mobile-menu', THEME_URI . '/mobile-menu.css');
[268] Fix | Delete
}
[269] Fix | Delete
if (function_exists('themify_theme_enqueue_header')) {
[270] Fix | Delete
themify_theme_enqueue_header();
[271] Fix | Delete
}
[272] Fix | Delete
/* Disabel Guttenberg Global Style WP 5.9 */
[273] Fix | Delete
// remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
[274] Fix | Delete
// wp_dequeue_style('global-styles');
[275] Fix | Delete
}
[276] Fix | Delete
}
[277] Fix | Delete
[278] Fix | Delete
public static function add_css(string $handle, string $src,?array $deps,?string $ver,?string $media = '',bool $in_footer = false) {
[279] Fix | Delete
if (!isset(self::$css[$handle], self::$done[$src])) {
[280] Fix | Delete
self::$done[$src] = true;
[281] Fix | Delete
if (!$media) {
[282] Fix | Delete
$media = 'all';
[283] Fix | Delete
}
[284] Fix | Delete
if (self::$concateFile === null || is_admin()) {
[285] Fix | Delete
if (strpos($handle, 'http') !== false) {
[286] Fix | Delete
$handle = crc32($handle);
[287] Fix | Delete
}
[288] Fix | Delete
self::$css[$handle] = array('s' => $src, 'v' => $ver);
[289] Fix | Delete
if ($media !== 'all') {//need to get css files in ajax call(e.g builder live preview)
[290] Fix | Delete
self::$css[$handle]['m'] = $media;
[291] Fix | Delete
}
[292] Fix | Delete
wp_enqueue_style($handle, $src, $deps, $ver, $media);
[293] Fix | Delete
return;
[294] Fix | Delete
}
[295] Fix | Delete
if ($in_footer === true || self::$isFooter === true) {
[296] Fix | Delete
if (!isset(self::$css['in_footer'])) {
[297] Fix | Delete
self::$css['in_footer'] = array();
[298] Fix | Delete
}
[299] Fix | Delete
self::$css['in_footer'][$handle] = array('s' => $src, 'v' => $ver);
[300] Fix | Delete
if ($media !== 'all') {
[301] Fix | Delete
self::$css['in_footer'][$handle]['m'] = $media;
[302] Fix | Delete
}
[303] Fix | Delete
} else {
[304] Fix | Delete
self::$css[$handle] = array('s' => $src, 'v' => $ver);
[305] Fix | Delete
if ($media !== 'all') {
[306] Fix | Delete
self::$css[$handle]['m'] = $media;
[307] Fix | Delete
}
[308] Fix | Delete
}
[309] Fix | Delete
}
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
/**
[313] Fix | Delete
* Deregister an stylesheet
[314] Fix | Delete
*
[315] Fix | Delete
* @param string $handle
[316] Fix | Delete
* @param string $both
[317] Fix | Delete
*/
[318] Fix | Delete
public static function remove_css(string $handle, string $type = 'both') {
[319] Fix | Delete
if ($handle !== 'in_footer' && self::$css !== null) {
[320] Fix | Delete
if ($type === 'both' || $type === 'main') {
[321] Fix | Delete
unset(self::$css[$handle], self::$css['in_footer'][$handle]);
[322] Fix | Delete
}
[323] Fix | Delete
if ($type === 'both' || $type === 'mobile') {
[324] Fix | Delete
unset(self::$css['mobile_concate'][$handle]);
[325] Fix | Delete
}
[326] Fix | Delete
}
[327] Fix | Delete
}
[328] Fix | Delete
[329] Fix | Delete
public static function header_meta() {
[330] Fix | Delete
?>
[331] Fix | Delete
<meta charset="<?php echo get_bloginfo('charset') ?>">
[332] Fix | Delete
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
[333] Fix | Delete
<?php
[334] Fix | Delete
}
[335] Fix | Delete
[336] Fix | Delete
public static function dev_mode_styles(){
[337] Fix | Delete
if ( ( themify_is_dev_mode() || Themify_Maintenance_Mode::is_enabled() ) && is_admin_bar_showing() ){
[338] Fix | Delete
if(is_admin()):
[339] Fix | Delete
?>
[340] Fix | Delete
<style>
[341] Fix | Delete
<?php endif;?>
[342] Fix | Delete
/* admin bar dev mode */
[343] Fix | Delete
#wpadminbar #wp-toolbar .tf_admin_bar_alert .ab-item{
[344] Fix | Delete
padding-left:24px
[345] Fix | Delete
}
[346] Fix | Delete
.tf_admin_bar_alert>.ab-item:after{
[347] Fix | Delete
content:'';
[348] Fix | Delete
width:12px;
[349] Fix | Delete
height:12px;
[350] Fix | Delete
border-radius:100%;
[351] Fix | Delete
background:#ff1212;
[352] Fix | Delete
position:absolute;
[353] Fix | Delete
top:50%;
[354] Fix | Delete
left:6px;
[355] Fix | Delete
transform:translateY(-50%);
[356] Fix | Delete
animation:tf_bg 2s infinite alternate
[357] Fix | Delete
}
[358] Fix | Delete
#wpadminbar .tf_admin_bar_tooltip{
[359] Fix | Delete
width:300px;
[360] Fix | Delete
color:#ccc;
[361] Fix | Delete
background-color:rgba(51,51,51,.9);
[362] Fix | Delete
padding:10px 14px;
[363] Fix | Delete
font-size:12px;
[364] Fix | Delete
line-height:1.2em;
[365] Fix | Delete
border-radius:8px;
[366] Fix | Delete
margin-top:50px;
[367] Fix | Delete
position:absolute;
[368] Fix | Delete
display:none;
[369] Fix | Delete
top:100%;
[370] Fix | Delete
left:0;
[371] Fix | Delete
box-sizing:border-box;
[372] Fix | Delete
z-index:999999
[373] Fix | Delete
}
[374] Fix | Delete
#wpadminbar .tf_admin_bar_alert>.ab-item:hover .tf_admin_bar_tooltip{display:block}
[375] Fix | Delete
@keyframes tf_bg{0%{background:#ffb800}100%{background:#ff1212}}
[376] Fix | Delete
<?php if(is_admin()):?>
[377] Fix | Delete
</style>
[378] Fix | Delete
<?php
[379] Fix | Delete
endif;
[380] Fix | Delete
}
[381] Fix | Delete
}
[382] Fix | Delete
[383] Fix | Delete
public static function wp_head() {
[384] Fix | Delete
if (themify_is_lazyloading() === true) {
[385] Fix | Delete
$blur = (int) themify_get('setting-lazy-blur', 25, true);
[386] Fix | Delete
?>
[387] Fix | Delete
<style id="tf_lazy_style" data-no-optimize="1">
[388] Fix | Delete
.tf_svg_lazy{
[389] Fix | Delete
content-visibility:auto;
[390] Fix | Delete
background-size:100% 25%!important;
[391] Fix | Delete
background-repeat:no-repeat!important;
[392] Fix | Delete
background-position:0 0, 0 33.4%,0 66.6%,0 100%!important;
[393] Fix | Delete
transition:filter .3s linear!important;
[394] Fix | Delete
<?php if ($blur > 0): ?>filter:blur(<?php echo $blur ?>px)!important;<?php endif; ?>
[395] Fix | Delete
transform:translateZ(0)
[396] Fix | Delete
}
[397] Fix | Delete
.tf_svg_lazy_loaded{
[398] Fix | Delete
filter:blur(0)!important
[399] Fix | Delete
}
[400] Fix | Delete
[data-lazy]:is(.module,.module_row:not(.tb_first)),.module[data-lazy] .ui,.module_row[data-lazy]:not(.tb_first):is(>.row_inner,.module_column[data-lazy],.module_subrow[data-lazy]){
[401] Fix | Delete
background-image:none!important
[402] Fix | Delete
}
[403] Fix | Delete
</style>
[404] Fix | Delete
<noscript>
[405] Fix | Delete
<style>
[406] Fix | Delete
.tf_svg_lazy{
[407] Fix | Delete
display:none!important
[408] Fix | Delete
}
[409] Fix | Delete
</style>
[410] Fix | Delete
</noscript>
[411] Fix | Delete
<?php
[412] Fix | Delete
}
[413] Fix | Delete
?>
[414] Fix | Delete
<style id="tf_lazy_common" data-no-optimize="1">
[415] Fix | Delete
<?php if (self::$themeVersion !== null): ?>
[416] Fix | Delete
img{
[417] Fix | Delete
max-width:100%;
[418] Fix | Delete
height:auto
[419] Fix | Delete
}
[420] Fix | Delete
<?php endif; ?>
[421] Fix | Delete
<?php self::dev_mode_styles()?>
[422] Fix | Delete
:where(.tf_in_flx,.tf_flx){display:inline-flex;flex-wrap:wrap;place-items:center}
[423] Fix | Delete
.tf_fa,:is(em,i) tf-lottie{display:inline-block;vertical-align:middle}:is(em,i) tf-lottie{width:1.5em;height:1.5em}.tf_fa{width:1em;height:1em;stroke-width:0;stroke:currentColor;overflow:visible;fill:currentColor;pointer-events:none;text-rendering:optimizeSpeed;buffered-rendering:static}#tf_svg symbol{overflow:visible}:where(.tf_lazy){position:relative;visibility:visible;display:block;opacity:.3}.wow .tf_lazy:not(.tf_swiper-slide){visibility:hidden;opacity:1}div.tf_audio_lazy audio{visibility:hidden;height:0;display:inline}.mejs-container{visibility:visible}.tf_iframe_lazy{transition:opacity .3s ease-in-out;min-height:10px}:where(.tf_flx),.tf_swiper-wrapper{display:flex}.tf_swiper-slide{flex-shrink:0;opacity:0;width:100%;height:100%}.tf_swiper-wrapper>br,.tf_lazy.tf_swiper-wrapper .tf_lazy:after,.tf_lazy.tf_swiper-wrapper .tf_lazy:before{display:none}.tf_lazy:after,.tf_lazy:before{content:'';display:inline-block;position:absolute;width:10px!important;height:10px!important;margin:0 3px;top:50%!important;inset-inline:auto 50%!important;border-radius:100%;background-color:currentColor;visibility:visible;animation:tf-hrz-loader infinite .75s cubic-bezier(.2,.68,.18,1.08)}.tf_lazy:after{width:6px!important;height:6px!important;inset-inline:50% auto!important;margin-top:3px;animation-delay:-.4s}@keyframes tf-hrz-loader{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.1);opacity:.6}}.tf_lazy_lightbox{position:fixed;background:rgba(11,11,11,.8);color:#ccc;top:0;left:0;display:flex;align-items:center;justify-content:center;z-index:999}.tf_lazy_lightbox .tf_lazy:after,.tf_lazy_lightbox .tf_lazy:before{background:#fff}.tf_vd_lazy,tf-lottie{display:flex;flex-wrap:wrap}tf-lottie{aspect-ratio:1.777}.tf_w.tf_vd_lazy video{width:100%;height:auto;position:static;object-fit:cover}
[424] Fix | Delete
</style>
[425] Fix | Delete
<?php if (self::$themeVersion !== null){
[426] Fix | Delete
themify_favicon_action();
[427] Fix | Delete
}
[428] Fix | Delete
self::$isHeader = true;
[429] Fix | Delete
}
[430] Fix | Delete
[431] Fix | Delete
/**
[432] Fix | Delete
* Outputs Header Code
[433] Fix | Delete
*
[434] Fix | Delete
* Hooked to "wp_head"[10], load after other scripts in the header
[435] Fix | Delete
*/
[436] Fix | Delete
public static function header_html(){
[437] Fix | Delete
echo themify_get('setting-header_html', '', true);
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
public static function css_position(){
[441] Fix | Delete
echo '<!--tf_css_position-->';//bug in chrome https://bugs.chromium.org/p/chromium/issues/detail?id=332189x
[442] Fix | Delete
}
[443] Fix | Delete
[444] Fix | Delete
public static function style_header_tag(string $tag, string $handle,string $href,string $media):string {
[445] Fix | Delete
$src = strtok($href, '?');
[446] Fix | Delete
unset(self::$preLoadMedia[$src]);
[447] Fix | Delete
$preload = '<link rel="preload" href="' . $href . '" as="style"';
[448] Fix | Delete
if ($media !== 'all' && $media) {
[449] Fix | Delete
$preload .= ' media="' . $media . '"';
[450] Fix | Delete
}
[451] Fix | Delete
$preload .= '>' . $tag;
[452] Fix | Delete
return $preload;
[453] Fix | Delete
}
[454] Fix | Delete
[455] Fix | Delete
/**
[456] Fix | Delete
* Set a default title for the front page
[457] Fix | Delete
*
[458] Fix | Delete
* @return string
[459] Fix | Delete
* @since 1.7.6
[460] Fix | Delete
*/
[461] Fix | Delete
public static function wp_title(string $title,string $sep):string {
[462] Fix | Delete
if (empty($title) && ( is_home() || is_front_page() )) {
[463] Fix | Delete
global $aioseop_options;
[464] Fix | Delete
return !empty($aioseop_options) && class_exists('All_in_One_SEO_Pack',false) ? $aioseop_options['aiosp_home_title'] : get_bloginfo('name');
[465] Fix | Delete
}
[466] Fix | Delete
return str_replace($sep, '', $title);
[467] Fix | Delete
}
[468] Fix | Delete
[469] Fix | Delete
public static function wc_shortcode_product($query_args, $attr, $type) {
[470] Fix | Delete
if ($type === 'product') {
[471] Fix | Delete
self::$wc_shortcode_type[$type] = true;
[472] Fix | Delete
}
[473] Fix | Delete
return $query_args;
[474] Fix | Delete
}
[475] Fix | Delete
[476] Fix | Delete
public static function wc_shortcode_product_page() {
[477] Fix | Delete
self::$wc_shortcode_type['product'] = true;
[478] Fix | Delete
}
[479] Fix | Delete
[480] Fix | Delete
public static function wc_shortcode_checkout() {
[481] Fix | Delete
self::$wc_shortcode_type['checkout'] = true;
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
public static function wc_shortcode_account($msg = '') {
[485] Fix | Delete
self::$wc_shortcode_type['account'] = true;
[486] Fix | Delete
return $msg;
[487] Fix | Delete
}
[488] Fix | Delete
[489] Fix | Delete
public static function js_localize() {
[490] Fix | Delete
[491] Fix | Delete
//remove_action('wp_footer', array(__CLASS__, 'js_localize'), 18);
[492] Fix | Delete
self::localize_script('themify-main-script', 'themify_vars', apply_filters('themify_main_script_vars', self::$localiztion));
[493] Fix | Delete
if(!is_admin()){
[494] Fix | Delete
global $wp_scripts;
[495] Fix | Delete
$inline_js=$wp_scripts->registered['themify-main-script']->extra['data'];
[496] Fix | Delete
if(!empty(self::$wc_data)){
[497] Fix | Delete
$inline_js.=implode('',self::$wc_data);
[498] Fix | Delete
}
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function