avada_builder.php
8 months ago
bricks_builder.php
8 months ago
divi_theme.php
8 months ago
google_site_kit.php
8 months ago
hive_press.php
8 months ago
maintenance.php
8 months ago
oxygen_builder.php
8 months ago
the_events_calendar.php
8 months ago
wpml.php
8 months ago
bricks_builder.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Legacy\EmailEncoderBundle\Integration; |
| 4 | |
| 5 | class BricksBuilder { |
| 6 | |
| 7 | public function boot(): void { |
| 8 | add_filter( 'eeb/settings/fields', [ $this, 'deactivate_logic' ], 10 ); |
| 9 | } |
| 10 | |
| 11 | |
| 12 | public function is_active(): bool { |
| 13 | return function_exists( 'bricks_is_builder' ); |
| 14 | } |
| 15 | |
| 16 | |
| 17 | public function deactivate_logic( $fields ) { |
| 18 | |
| 19 | if ( ! $this->is_active() ) { |
| 20 | return $fields; |
| 21 | } |
| 22 | |
| 23 | if ( function_exists( 'bricks_is_builder' ) && bricks_is_builder() ) { |
| 24 | if ( is_array( $fields ) ) { |
| 25 | if ( isset( $fields[ 'protect' ] ) ) { |
| 26 | if ( isset( $fields[ 'protect' ]['value'] ) ) { |
| 27 | $fields[ 'protect' ]['value'] = 3; |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | return $fields; |
| 34 | } |
| 35 | |
| 36 | } |
| 37 |