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/wp-conte.../plugins/themify-.../themify/plugin-c...
File: woocommerce.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Themify Compatibility Code
[2] Fix | Delete
*
[3] Fix | Delete
* @package Themify
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* WooCommerce
[8] Fix | Delete
* @link https://woocommerce.com/
[9] Fix | Delete
*/
[10] Fix | Delete
class Themify_Compat_woocommerce {
[11] Fix | Delete
[12] Fix | Delete
static function init() {
[13] Fix | Delete
add_action( 'template_redirect', array( __CLASS__, 'template_redirect' ) );
[14] Fix | Delete
add_action( 'woocommerce_init', array( __CLASS__, 'woocommerce_init' ) );
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
public static function woocommerce_init() {
[18] Fix | Delete
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper' );
[19] Fix | Delete
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end' );
[20] Fix | Delete
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar' );
[21] Fix | Delete
add_action( 'woocommerce_before_main_content', 'themify_before_wrap_content', 1 );
[22] Fix | Delete
add_action( 'woocommerce_after_main_content', 'themify_after_wrap_content', 100 );
[23] Fix | Delete
if ( current_theme_supports( 'themify-sticky-buy' ) ) {
[24] Fix | Delete
add_action( 'template_redirect', 'themify_wc_sticky_buy', 12 );
[25] Fix | Delete
}
[26] Fix | Delete
if ( current_theme_supports( 'themify-wc-accordion-tabs' ) ) {
[27] Fix | Delete
$tabType=themify_get( 'setting-product_tabs_layout','tab',true );
[28] Fix | Delete
if('none'===$tabType){
[29] Fix | Delete
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
[30] Fix | Delete
}elseif($tabType==='accordion'){
[31] Fix | Delete
add_filter( 'wc_get_template', 'themify_wc_accordion_tabs', 10, 5 );
[32] Fix | Delete
}
[33] Fix | Delete
}
[34] Fix | Delete
add_filter( 'body_class', array( __CLASS__, 'single_product_body_class' ) );
[35] Fix | Delete
add_action( 'woocommerce_before_shop_loop_item', 'themify_post_edit_link' );
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Fix video display in Focus Mode
[40] Fix | Delete
*
[41] Fix | Delete
* @access public
[42] Fix | Delete
*/
[43] Fix | Delete
public static function template_redirect() {
[44] Fix | Delete
global $themify;
[45] Fix | Delete
if ( $themify->page_title === 'yes' && themify_is_shop() ) {
[46] Fix | Delete
add_filter( 'woocommerce_show_page_title', '__return_false', 100 );
[47] Fix | Delete
}
[48] Fix | Delete
if ( is_product() ) {
[49] Fix | Delete
add_filter( 'woocommerce_post_class', [ __CLASS__, 'woocommerce_post_class' ], 10, 2 );
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* Add Product taxonomy as Body Class to Single Product Page
[55] Fix | Delete
*
[56] Fix | Delete
* @access public
[57] Fix | Delete
*/
[58] Fix | Delete
public static function single_product_body_class($classes) {
[59] Fix | Delete
$classes[]='woocommerce-js';
[60] Fix | Delete
$index=array_search('woocommerce-no-js', $classes,true);
[61] Fix | Delete
if($index!==false){
[62] Fix | Delete
unset($classes[$index]);
[63] Fix | Delete
}
[64] Fix | Delete
if ( is_singular( 'product' ) ) {
[65] Fix | Delete
$current_product = wc_get_product();
[66] Fix | Delete
$id = $current_product->get_id();
[67] Fix | Delete
$tax = array('product_cat','product_tag');
[68] Fix | Delete
foreach($tax as $v){
[69] Fix | Delete
$custom_terms = get_the_terms( $id, $v );
[70] Fix | Delete
if ( $custom_terms ) {
[71] Fix | Delete
foreach ( $custom_terms as $custom_term ) {
[72] Fix | Delete
$classes[] = $v . '_' . $custom_term->slug;
[73] Fix | Delete
}
[74] Fix | Delete
}
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
return $classes;
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
public static function woocommerce_post_class( $classes, $product ) {
[81] Fix | Delete
if ( $product->get_id() === get_queried_object_id() ) {
[82] Fix | Delete
$classes[] = 'tf_clearfix';
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
return $classes;
[86] Fix | Delete
}
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
if ( ! function_exists( 'themify_wc_accordion_tabs' ) ) :
[90] Fix | Delete
function themify_wc_accordion_tabs( $located, $template_name, $args, $template_path, $default_path ) {
[91] Fix | Delete
if ( 'single-product/tabs/tabs.php' == $template_name) {
[92] Fix | Delete
remove_filter( 'wc_get_template', 'themify_wc_accordion_tabs', 10);
[93] Fix | Delete
return THEMIFY_DIR.'/includes/wc-accordion-tabs.php';
[94] Fix | Delete
}
[95] Fix | Delete
return $located;
[96] Fix | Delete
}
[97] Fix | Delete
endif;
[98] Fix | Delete
[99] Fix | Delete
if ( ! function_exists( 'themify_wc_sticky_buy' ) ) :
[100] Fix | Delete
function themify_wc_sticky_buy(){
[101] Fix | Delete
if ( is_product() && ! ( class_exists('Themify_Builder_Model',false) && Themify_Builder_Model::is_front_builder_activate() ) && ! themify_check('setting-st_add_cart', true ) ) {
[102] Fix | Delete
add_action( 'woocommerce_before_add_to_cart_form', 'themify_sticky_buy_observer_start' );
[103] Fix | Delete
add_action( 'woocommerce_after_add_to_cart_form', 'themify_sticky_buy_observer_end' );
[104] Fix | Delete
}
[105] Fix | Delete
}
[106] Fix | Delete
endif;
[107] Fix | Delete
[108] Fix | Delete
[109] Fix | Delete
if ( ! function_exists( 'themify_sticky_buy_observer_start' ) ) :
[110] Fix | Delete
function themify_sticky_buy_observer_start() {
[111] Fix | Delete
ob_start();
[112] Fix | Delete
echo '<div id="tf_sticky_form_wrap" data-lazy="1">';
[113] Fix | Delete
return ob_end_flush();
[114] Fix | Delete
}
[115] Fix | Delete
endif;
[116] Fix | Delete
[117] Fix | Delete
if ( ! function_exists( 'themify_sticky_buy_observer_end' ) ) :
[118] Fix | Delete
function themify_sticky_buy_observer_end() {
[119] Fix | Delete
ob_start();
[120] Fix | Delete
echo '</div>';
[121] Fix | Delete
return ob_end_flush();
[122] Fix | Delete
}
[123] Fix | Delete
endif;
[124] Fix | Delete
[125] Fix | Delete
if ( ! function_exists( 'themify_before_wrap_content' ) ) :
[126] Fix | Delete
function themify_before_wrap_content() {
[127] Fix | Delete
if ( function_exists( 'themify_before_shop_content' ) && current_action() === 'woocommerce_before_main_content' ) {
[128] Fix | Delete
return;
[129] Fix | Delete
}
[130] Fix | Delete
?>
[131] Fix | Delete
<!-- layout -->
[132] Fix | Delete
<div id="layout" class="pagewidth tf_box tf_clearfix">
[133] Fix | Delete
<?php themify_content_before(); // Hook ?>
[134] Fix | Delete
<!-- content -->
[135] Fix | Delete
<main id="content" class="tf_box tf_clearfix">
[136] Fix | Delete
<?php themify_content_start(); // Hook
[137] Fix | Delete
}
[138] Fix | Delete
endif;
[139] Fix | Delete
[140] Fix | Delete
if ( ! function_exists( 'themify_after_wrap_content' ) ) :
[141] Fix | Delete
function themify_after_wrap_content() {
[142] Fix | Delete
if ( function_exists( 'themify_after_shop_content' ) && current_action() === 'woocommerce_after_main_content' ) {
[143] Fix | Delete
return;
[144] Fix | Delete
}
[145] Fix | Delete
themify_content_end(); // Hook
[146] Fix | Delete
?>
[147] Fix | Delete
</main>
[148] Fix | Delete
<!-- /#content -->
[149] Fix | Delete
<?php
[150] Fix | Delete
themify_content_after(); // Hook
[151] Fix | Delete
themify_get_sidebar();
[152] Fix | Delete
?>
[153] Fix | Delete
</div><!-- /#layout -->
[154] Fix | Delete
<?php
[155] Fix | Delete
}
[156] Fix | Delete
endif;
[157] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function