Skip to content

Commit

Permalink
content filter multiple selection not working
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-shafi committed Jul 6, 2024
1 parent 04a0890 commit 51cd788
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ That's it. You're done!

= 3.2.1 =

* FIX: Content Filter multiple selection not working.
* FIX: Content Toggle performance issue.
* FIX: Post Excerpt null warning in post grid block.
* FIX: Post image preserve aspect ratio not working properly on frontend.
Expand Down
5 changes: 2 additions & 3 deletions src/blocks/content-filter/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ function ub_render_content_filter_block($attributes, $content){
$filterList = '';

foreach((array)$newFilterArray as $key1 => $filterGroup){
$filterList .= '<div class="ub-content-filter-category"
data-canUseMultiple="' . json_encode($filterGroup['canUseMultiple']) . '">
$filterList .= '<div class="ub-content-filter-category">
<div class="ub-content-filter-category-name">' . wp_kses_post($filterGroup['category']) . '</div>';
$filters = '<div class="ub-content-filter-buttons-wrapper">';
$filters = '<div class="ub-content-filter-buttons-wrapper" data-canUseMultiple="' . json_encode($filterGroup['canUseMultiple']) . '">';
foreach($filterGroup['filters'] as $key2 => $tag){
$filters .= '<div data-tagIsSelected="false" data-categoryNumber="' . $key1 . '"
data-filterNumber="' . $key2 . '" ' . ($blockID === '' ? 'data-normalColor="' . esc_attr($buttonColor) . '" data-normalTextColor="' . esc_attr($buttonTextColor) .
Expand Down
1 change: 1 addition & 0 deletions src/blocks/content-filter/front.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Array.prototype.slice.call(document.getElementsByClassName("ub-content-filter-ta
this.classList.toggle("ub-selected");
}
var categoryIndex = JSON.parse(this.getAttribute("data-categorynumber"));
console.log(this.parentElement);
var filterIndex = JSON.parse(this.getAttribute("data-filternumber"));
if (JSON.parse(this.getAttribute("data-tagisselected"))) {
if (!JSON.parse(this.parentElement.getAttribute("data-canusemultiple"))) {
Expand Down
1 change: 1 addition & 0 deletions src/blocks/content-filter/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Array.prototype.slice
const categoryIndex = JSON.parse(
this.getAttribute("data-categorynumber"),
);
console.log(this.parentElement);
const filterIndex = JSON.parse(this.getAttribute("data-filternumber"));

if (JSON.parse(this.getAttribute("data-tagisselected"))) {
Expand Down

0 comments on commit 51cd788

Please sign in to comment.