Skip to content

Commit

Permalink
Bugfix: Aggressive wp_kses filter prevents add to cart tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Sep 11, 2022
1 parent 1b54145 commit afea225
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Admin/OptionsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function setting_row( string $type, string $variable, string $label, arra
<?php $this->setting_field( $type, $variable, $field_data ) ?>
<?php if ( ! empty( $description ) ): ?>
<p class="desc">
<?php echo wp_kses( $description, ['a' => [], 'br' => []] ); ?>
<?php echo wp_kses( $description, ['a' => ['href' => []], 'br' => []] ); ?>
</p>
<?php endif; ?>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/Integration/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,14 @@ function product_list_loop_add_to_cart_tracking(): void {
$list_name,
$woocommerce_loop['loop']
),
['span' => []]
[
'span' => [
'class' => [],
'style' => [],
'data-gtmkit_product_id' => [],
'data-gtmkit_product_data' => [],
],
]
);
}

Expand Down

0 comments on commit afea225

Please sign in to comment.