Divi.php
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Divi compatibility controller.
*
* @package ContentControl\Admin
* @copyright (c) 2023 Code Atlantic LLC
*/
namespace ContentControl\Controllers\Compatibility;
use ContentControl\Base\Controller;
/**
* Divi controller class.
*/
class Divi extends Controller {
/**
* Initialize widget editor UX.
*
* @return void
*/
public function init() {
add_filter( 'content_control/protection_is_disabled', [ $this, 'protection_is_disabled' ] );
}
/**
* Check if controller is enabled.
*
* @return bool
*/
public function controller_enabled() {
return defined( 'ET_CORE_VERSION' );
}
/**
* Conditionally disable Content Control for Divi builder.
*
* @param boolean $protection_is_disabled Whether protection is disabled.
* @return boolean
*/
public function protection_is_disabled( $protection_is_disabled ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['et_fb'] ) && ! empty( $_GET['et_fb'] ) ) {
return true;
}
return $protection_is_disabled;
}
}