| @@ -634,10 +634,11 @@ | ||
| 634 | 634 | $post_types = json_decode( $post_types, true ); |
| 635 | 635 | } |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | - $attr['blockId'] = ultimate_post()->sanitize_attr( $attr, 'blockId', 'sanitize_html_class', 'missing_block_id' ); | |
| 639 | - $attr['allText'] = ultimate_post()->sanitize_attr( $attr, 'allText', 'sanitize_text_field', 'missing_block_id' ); | |
| 638 | + $attr['blockId'] = ultimate_post()->sanitize_attr( $attr, 'blockId', 'sanitize_html_class', 'missing_block_id' ); | |
| 639 | + $attr['allText'] = ultimate_post()->sanitize_attr( $attr, 'allText', 'sanitize_text_field', 'missing_block_id' ); | |
| 640 | + $current_page_post_id = ( isset( $attr['currentPostId'] ) && $attr['currentPostId'] ) ? sanitize_html_class( $attr['currentPostId'] ) : ultimate_post()->get_page_post_id( $attr['blockId'] ); | |
| 640 | 641 | |
| 641 | 642 | if ( 'inline' === $attr['filterStyle'] ) { |
| 642 | 643 | $inline_values = json_decode( $attr['filterValues'], true ); |
| 643 | 644 | |
| @@ -653,9 +654,9 @@ | ||
| 653 | 654 | 'role' => 'button', |
| 654 | 655 | 'data-blockId' => $attr['blockId'], |
| 655 | 656 | 'data-is-active' => 'false', |
| 656 | 657 | 'data-builder' => ultimate_post()->get_builder_attr( 'archiveBuilderFilter' ), |
| 657 | - 'data-current-postid' => get_the_ID(), | |
| 658 | + 'data-current-postid' => $current_page_post_id, | |
| 658 | 659 | 'data-filter-label' => isset( $attr['allText'] ) ? $attr['allText'] : 'All', |
| 659 | 660 | ) |
| 660 | 661 | ); |
| 661 | 662 | |
| @@ -715,9 +716,9 @@ | ||
| 715 | 716 | 'data-blockId' => $attr['blockId'], |
| 716 | 717 | 'aria-expanded' => 'false', |
| 717 | 718 | 'aria-label' => 'Select Filter (' . $attr['type'] . ')', |
| 718 | 719 | 'data-builder' => ultimate_post()->get_builder_attr( 'archiveBuilderFilter' ), |
| 719 | - 'data-current-postid' => get_the_ID(), | |
| 720 | + 'data-current-postid' => $current_page_post_id, | |
| 720 | 721 | 'data-filter-label' => isset( $def_value['name'] ) ? $def_value['name'] : 'All', |
| 721 | 722 | ) |
| 722 | 723 | ); |
| 723 | 724 | |