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.../themes/Divi/includes/builder/plugin-c...
File: divi_woo_layout_injector.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit; // Exit if accessed directly
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Plugin compatibility for Divi Woo Layout Injector.
[7] Fix | Delete
*
[8] Fix | Delete
* @since 4.0.5
[9] Fix | Delete
*
[10] Fix | Delete
* @link https://elegantmarketplace.com/downloads/woo-layout-injector-subscription/
[11] Fix | Delete
*/
[12] Fix | Delete
class ET_Builder_Plugin_Compat_Divi_Woo_Layout_Injector extends ET_Builder_Plugin_Compat_Base {
[13] Fix | Delete
/**
[14] Fix | Delete
* Constructor.
[15] Fix | Delete
*/
[16] Fix | Delete
function __construct() {
[17] Fix | Delete
$this->plugin_id = 'divi_woo_layout_injector/divi_woo_layout_injector.php';
[18] Fix | Delete
[19] Fix | Delete
$this->init_hooks();
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Hook methods to WordPress.
[24] Fix | Delete
*
[25] Fix | Delete
* @return void
[26] Fix | Delete
*/
[27] Fix | Delete
function init_hooks() {
[28] Fix | Delete
// Bail if there's no version found
[29] Fix | Delete
if ( ! $this->get_plugin_version() ) {
[30] Fix | Delete
return;
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
add_filter( 'the_content', array( $this, 'maybe_disable_in_the_content' ), 998 );
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Disable layout injection when editing TB layouts.
[38] Fix | Delete
*
[39] Fix | Delete
* @since 4.0.5
[40] Fix | Delete
*
[41] Fix | Delete
* @param string $content
[42] Fix | Delete
*
[43] Fix | Delete
* @return string
[44] Fix | Delete
*/
[45] Fix | Delete
function maybe_disable_in_the_content( $content ) {
[46] Fix | Delete
$is_tb = et_theme_builder_is_layout_post_type( get_post_type( get_the_ID() ) );
[47] Fix | Delete
[48] Fix | Delete
if ( $is_tb ) {
[49] Fix | Delete
remove_filter( 'the_content', 'sb_et_woo_li_content_filter', 999 );
[50] Fix | Delete
} else if ( did_action( 'plugins_loaded' ) && ! has_action( 'the_content', 'sb_et_woo_li_content_filter' ) ) {
[51] Fix | Delete
add_filter( 'the_content', 'sb_et_woo_li_content_filter', 999 );
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
return $content;
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
new ET_Builder_Plugin_Compat_Divi_Woo_Layout_Injector();
[59] Fix | Delete
[60] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function