avada_builder.php
6 months ago
bricks_builder.php
6 months ago
divi_theme.php
6 months ago
google_site_kit.php
6 months ago
hive_press.php
6 months ago
maintenance.php
6 months ago
oxygen_builder.php
6 months ago
the_events_calendar.php
6 months ago
wpml.php
6 months ago
google_site_kit.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Legacy\EmailEncoderBundle\Integration; |
| 4 | |
| 5 | use OnlineOptimisation\EmailEncoderBundle\Integrations\IntegrationInterface; |
| 6 | use OnlineOptimisation\EmailEncoderBundle\Traits\PluginHelper; |
| 7 | |
| 8 | class GoogleSiteKit implements IntegrationInterface { |
| 9 | |
| 10 | use PluginHelper; |
| 11 | |
| 12 | public function boot(): void { |
| 13 | add_filter( 'googlesitekit_admin_data', [ $this, 'soft_encode_admin_data' ], 100, 1 ); |
| 14 | } |
| 15 | |
| 16 | |
| 17 | /** |
| 18 | * @param array< string, array< string, mixed > > $admin_data |
| 19 | * @return array< string, array< string, mixed > > |
| 20 | */ |
| 21 | public function soft_encode_admin_data( $admin_data ) { |
| 22 | |
| 23 | $soft_encode = apply_filters( 'eeb/integrations/google_site_kit/soft_encode', true ); |
| 24 | |
| 25 | if ( isset( $admin_data['userData'] ) && isset( $admin_data['userData']['email'] ) ) { |
| 26 | |
| 27 | $admin_data['userData']['email'] = $soft_encode |
| 28 | ? antispambot( $admin_data['userData']['email'] ) |
| 29 | : $this->validate()->encoding->temp_encode_at_symbol( $admin_data['userData']['email'] ) |
| 30 | ; |
| 31 | |
| 32 | } |
| 33 | |
| 34 | return $admin_data; |
| 35 | } |
| 36 | |
| 37 | } |
| 38 |