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
avada_builder.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Legacy\EmailEncoderBundle\Integration; |
| 4 | |
| 5 | class AvadaBuilder { |
| 6 | |
| 7 | public function boot() { |
| 8 | add_filter( 'eeb/settings/fields', [ $this, 'deactivate_logic' ], 10 ); |
| 9 | } |
| 10 | |
| 11 | public function is_active() { |
| 12 | return defined( 'FUSION_BUILDER_VERSION' ); |
| 13 | } |
| 14 | |
| 15 | public function deactivate_logic( $fields ) { |
| 16 | |
| 17 | if ( ! $this->is_active() ) { |
| 18 | return $fields; |
| 19 | } |
| 20 | |
| 21 | $condition = isset( $_GET['fb-edit'] ) |
| 22 | && is_array( $fields ) |
| 23 | && isset( $fields[ 'protect' ]['value'] ) |
| 24 | ; |
| 25 | |
| 26 | if ( $condition ) { |
| 27 | $fields[ 'protect' ]['value'] = 3; //3 equals "Do Nothing" |
| 28 | } |
| 29 | |
| 30 | return $fields; |
| 31 | } |
| 32 | |
| 33 | } |
| 34 |