| Server IP : 170.10.161.225 / Your IP : 216.73.216.78 Web Server : Apache System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : calvet ( 273824) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : ON Directory : /home/www/calvetrealty.com/wp-content/themes/Divi/includes/builder/compat/ |
Upload File : |
<?php
/**
* Compatibility code that deals with 3P Services which are not integrated via
* WP Plugins (eg. code added via integration / Code Module) because not hosted locally.
*
* @package Divi
* @subpackage Builder
* @since 4.10.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Disable JQuery Body feature when certain 3P form services are used.
// phpcs:disable PEAR.Functions.FunctionCallSignature.MultipleArguments -- Anonymous functions.
// phpcs:disable PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket -- Anonymous functions.
// phpcs:disable PEAR.Functions.FunctionCallSignature.CloseBracketLine -- Anonymous functions.
add_filter( 'et_builder_enable_jquery_body', function( $enabled, $content = '' ) {
if ( empty( $content ) ) {
return $enabled;
}
$services = [
'et_builder_disable_jquery_body',
'slick.js',
'webforms/bbox-min.js',
'www.cognitoforms.com',
'mailchimp.com',
'mindbodyonline.com/javascripts',
'static.smartrecruiters.com/job-widget/',
'default.salsalabs.org/api/widget/',
];
$services = array_filter( $services, 'preg_quote' );
$pattern = '#(' . implode( '|', $services ) . ')#';
// Disable when the service is found.
return 1 === preg_match( $pattern, $content ) ? false : $enabled;
}, 10, 2);
// phpcs:enable