Advanced AJAX Product Filters - Version 1.3.1.8

Version Description

  • Enhancement - Compatibility with Elementor and other plugins
  • Enhancement - Compatibility with other BeRocket plugins
  • Enhancement - Code Security
Download this release

Release Info

Developer RazyRx
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.3.1.8
Comparing to
See all releases

Code changes from version 1.3.1.7 to 1.3.1.8

berocket/framework.php CHANGED
@@ -34,7 +34,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
34
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
35
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
36
  class BeRocket_Framework {
37
- public static $framework_version = '2.1';
38
  public static $settings_name = '';
39
  public $addons;
40
  public $libraries;
@@ -104,9 +104,6 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
104
  }
105
  do_action($this->info[ 'plugin_name' ].'_framework_construct', $this->cc);
106
  add_filter('brfr_get_plugin_version_capability_'.$this->cc->info['plugin_name'], array($this, 'get_plugin_version_capability'));
107
- if( is_admin() ) {
108
- $this->plugin_version_check();
109
- }
110
  }
111
  public function include_once_files() {
112
  foreach (glob($this->info['plugin_dir'] . "/includes/*.php") as $filename)
@@ -349,6 +346,9 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
349
  * @return void
350
  */
351
  public function admin_init() {
 
 
 
352
  if( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
353
  berocket_admin_notices::generate_subscribe_notice();
354
  if( empty($this->feature_list) || ! is_array($this->feature_list) || ! count($this->feature_list) ) {
34
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
35
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
36
  class BeRocket_Framework {
37
+ public static $framework_version = '2.2';
38
  public static $settings_name = '';
39
  public $addons;
40
  public $libraries;
104
  }
105
  do_action($this->info[ 'plugin_name' ].'_framework_construct', $this->cc);
106
  add_filter('brfr_get_plugin_version_capability_'.$this->cc->info['plugin_name'], array($this, 'get_plugin_version_capability'));
 
 
 
107
  }
108
  public function include_once_files() {
109
  foreach (glob($this->info['plugin_dir'] . "/includes/*.php") as $filename)
346
  * @return void
347
  */
348
  public function admin_init() {
349
+ if( is_admin() ) {
350
+ $this->plugin_version_check();
351
+ }
352
  if( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
353
  berocket_admin_notices::generate_subscribe_notice();
354
  if( empty($this->feature_list) || ! is_array($this->feature_list) || ! count($this->feature_list) ) {
berocket/framework_version.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $framework_version_current = '2.1';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
1
  <?php
2
+ $framework_version_current = '2.2';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
berocket/includes/custom_post.php CHANGED
@@ -354,6 +354,7 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
354
  }
355
  //SORTABLE CUSTOM POST
356
  public function sortable_admin_init() {
 
357
  add_action( 'pre_get_posts', array($this, 'sortable_get_posts') );
358
  if( ! empty($_POST['braction']) && $_POST['braction'] == 'berocket_custom_post_sortable' ) {
359
  $this->sortable_change();
@@ -379,11 +380,23 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
379
  }
380
  }
381
  public function sortable_get_custom_post($args) {
 
 
 
 
382
  $args = array_merge($args, array(
383
  'meta_key' => 'berocket_post_order',
384
  'orderby' => 'meta_value_num',
385
  'order' => 'ASC',
386
  ));
 
 
 
 
 
 
 
 
387
  return $args;
388
  }
389
  public function sortable_wc_save_product_before( $post_id, $post ) {
354
  }
355
  //SORTABLE CUSTOM POST
356
  public function sortable_admin_init() {
357
+ $this->get_custom_posts();
358
  add_action( 'pre_get_posts', array($this, 'sortable_get_posts') );
359
  if( ! empty($_POST['braction']) && $_POST['braction'] == 'berocket_custom_post_sortable' ) {
360
  $this->sortable_change();
380
  }
381
  }
382
  public function sortable_get_custom_post($args) {
383
+ if( is_admin() ) {
384
+ $posts_not_ordered = new WP_Query($args);
385
+ $posts_not_ordered = $posts_not_ordered->posts;
386
+ }
387
  $args = array_merge($args, array(
388
  'meta_key' => 'berocket_post_order',
389
  'orderby' => 'meta_value_num',
390
  'order' => 'ASC',
391
  ));
392
+ if( is_admin() ) {
393
+ $posts_ordered = new WP_Query($args);
394
+ $posts_ordered = $posts_ordered->posts;
395
+ $posts_fix = array_diff($posts_not_ordered, $posts_ordered);
396
+ foreach($posts_fix as $post_fix_id) {
397
+ add_post_meta( $post_fix_id, 'berocket_post_order', '0', true );
398
+ }
399
+ }
400
  return $args;
401
  }
402
  public function sortable_wc_save_product_before( $post_id, $post ) {
includes/new_widget.php CHANGED
@@ -200,7 +200,12 @@ class BeRocket_new_AAPF_Widget_single extends WP_Widget
200
  $classes_arr = $additional_class_esc;
201
  $classes_arr = explode(' ', preg_replace('!\s+!', ' ', $classes_arr));
202
  $classes_arr = '.' . implode('.', $classes_arr);
203
- echo '<style>'.esc_html($classes_arr).' .berocket_aapf_widget {' . htmlentities($args['widget_inline_style'], ENT_HTML5) . '}</style>';
 
 
 
 
 
204
  }
205
  echo '<div class="' . $additional_class_esc . '" data-id="' . esc_html($instance['filter_id']) . '" style="'.htmlentities(br_get_value_from_array($args, 'inline_style')).'">';
206
  }
200
  $classes_arr = $additional_class_esc;
201
  $classes_arr = explode(' ', preg_replace('!\s+!', ' ', $classes_arr));
202
  $classes_arr = '.' . implode('.', $classes_arr);
203
+ $classes_arr .= ' .berocket_aapf_widget';
204
+ $classes_arr = esc_html($classes_arr);
205
+ echo '<style>';
206
+ echo $classes_arr;
207
+ echo '{' . htmlentities($args['widget_inline_style'], ENT_HTML5) . '}';
208
+ echo '</style>';
209
  }
210
  echo '<div class="' . $additional_class_esc . '" data-id="' . esc_html($instance['filter_id']) . '" style="'.htmlentities(br_get_value_from_array($args, 'inline_style')).'">';
211
  }
includes/widget.php CHANGED
@@ -164,6 +164,9 @@ class BeRocket_AAPF_Widget extends WP_Widget {
164
  $args['widget_id'] = $this->id;
165
  $this->number = 's'.$berocket_aapf_shortcode_id;
166
  }
 
 
 
167
  $filter_type_array = array(
168
  'attribute' => array(
169
  'name' => __('Attribute', 'BeRocket_AJAX_domain'),
@@ -479,9 +482,12 @@ class BeRocket_AAPF_Widget extends WP_Widget {
479
  if( apply_filters( 'berocket_aapf_widget_display_custom_filter', false, berocket_isset($widget_type), $instance, $args, $this ) ) return '';
480
 
481
  if ( ! empty($widget_type) && $widget_type == 'update_button' ) {
482
- set_query_var( 'title', apply_filters( 'berocket_aapf_widget_title', $title ) );
483
- set_query_var( 'uo', br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ) );
484
- set_query_var( 'is_hide_mobile', ( empty($is_hide_mobile) ? '' : $is_hide_mobile ) );
 
 
 
485
  echo $before_widget;
486
  br_get_template_part( 'widget_update_button' );
487
  echo $after_widget;
@@ -492,9 +498,12 @@ class BeRocket_AAPF_Widget extends WP_Widget {
492
  }
493
 
494
  if ( ! empty($widget_type) && $widget_type == 'reset_button' ) {
495
- set_query_var( 'title', apply_filters( 'berocket_aapf_widget_title', $title ) );
496
- set_query_var( 'uo', br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ) );
497
- set_query_var( 'is_hide_mobile', ( empty($is_hide_mobile) ? '' : $is_hide_mobile ) );
 
 
 
498
  echo $before_widget;
499
  br_get_template_part( 'widget_reset_button' );
500
  echo $after_widget;
@@ -508,12 +517,15 @@ class BeRocket_AAPF_Widget extends WP_Widget {
508
  if ( empty($scroll_theme) ) {
509
  $scroll_theme = 'dark';
510
  }
511
- set_query_var( 'title', apply_filters( 'berocket_aapf_widget_title', $title ) );
512
- set_query_var( 'uo', br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ) );
513
- set_query_var( 'is_hide_mobile', ( empty($is_hide_mobile) ? '' : $is_hide_mobile ) );
514
- set_query_var( 'selected_area_show', $selected_area_show );
515
- set_query_var( 'hide_selected_arrow', $hide_selected_arrow );
516
- set_query_var( 'selected_is_hide', $selected_is_hide );
 
 
 
517
  echo $before_widget;
518
  br_get_template_part( 'widget_selected_area' );
519
  echo $after_widget;
@@ -542,10 +554,9 @@ class BeRocket_AAPF_Widget extends WP_Widget {
542
  $instance['wp_check_product_cat'] = $wp_check_product_cat;
543
  $instance['wp_query_product_cat'] = $wp_query_product_cat;
544
  list($terms_error_return, $terms_ready, $terms, $type) = apply_filters( 'berocket_widget_attribute_type_terms', array(false, false, $terms, $type), $attribute, $filter_type, $instance );
545
-
546
  if( $terms_ready ) {
547
  if( $terms_error_return === FALSE ) {
548
- set_query_var( 'terms', apply_filters( 'berocket_aapf_widget_terms', $terms ) );
549
  if( BeRocket_AAPF::$debug_mode ) {
550
  $widget_error_log['terms'] = $terms;
551
  }
@@ -602,7 +613,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
602
  if( ! empty( $order_values_type ) && $order_values_type == 'desc' ) {
603
  $terms = array_reverse($terms);
604
  }
605
- set_query_var( 'terms', apply_filters( 'berocket_aapf_widget_terms', $terms ) );
606
  if( BeRocket_AAPF::$debug_mode ) {
607
  $widget_error_log['terms'] = $terms;
608
  }
@@ -660,7 +671,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
660
  $this->restore_wp_the_query($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query);
661
  return false;
662
  }
663
- set_query_var( 'terms', apply_filters( 'berocket_aapf_widget_terms', $terms ) );
664
  unset( $terms, $terms_unsort );
665
  } else {
666
  $sort_array = array();
@@ -703,7 +714,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
703
  if( BeRocket_AAPF::$debug_mode ) {
704
  $widget_error_log['terms'] = $terms;
705
  }
706
- set_query_var( 'terms', apply_filters( 'berocket_aapf_widget_terms', $terms ) );
707
  }
708
 
709
  } elseif ( $filter_type == 'tag' ) {
@@ -730,7 +741,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
730
 
731
  $terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance);
732
 
733
- set_query_var( 'terms', apply_filters( 'berocket_aapf_widget_terms', $terms ) );
734
 
735
  if ( empty($terms) || ! is_array($terms) || count( $terms ) < 1 ) {
736
  $widget_error_log['terms'] = $terms;
@@ -772,7 +783,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
772
  }
773
  $terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance);
774
 
775
- set_query_var( 'terms', apply_filters( 'berocket_aapf_widget_terms', $terms ) );
776
  $sort_array = self::sort_child_parent_hierarchy($terms);
777
  @ array_multisort( $sort_array, (empty($order_values_type) || $order_values_type == 'asc' ? SORT_ASC : SORT_DESC), SORT_NUMERIC, $terms );
778
 
@@ -804,47 +815,48 @@ class BeRocket_AAPF_Widget extends WP_Widget {
804
  $values_per_row = 1;
805
  }
806
 
807
- set_query_var( 'operator', $operator );
808
- set_query_var( 'attribute', $attribute );
809
- set_query_var( 'type', $type );
810
- set_query_var( 'title', apply_filters( 'berocket_aapf_widget_title', $title ) );
811
- set_query_var( 'class', apply_filters( 'berocket_aapf_widget_class', $class ) );
812
- set_query_var( 'css_class', apply_filters( 'berocket_aapf_widget_css_class', (isset($css_class) ? $css_class : '') ) );
813
- set_query_var( 'style', apply_filters( 'berocket_aapf_widget_style', $style ) );
814
- set_query_var( 'scroll_theme', $scroll_theme );
815
- set_query_var( 'x', time() );
816
- set_query_var( 'filter_type', $filter_type );
817
- set_query_var( 'uo', br_aapf_converter_styles( (empty($br_options['styles']) ? '' : $br_options['styles']) ) );
818
- set_query_var( 'notuo', (empty($br_options['styles']) ? '' : $br_options['styles']) );
819
- set_query_var( 'widget_is_hide', (! empty($widget_collapse_enable) && ! empty($widget_is_hide)) );
820
- set_query_var( 'widget_collapse_disable', empty($widget_collapse_enable) );
821
- set_query_var( 'is_hide_mobile', ! empty($is_hide_mobile) );
822
- set_query_var( 'show_product_count_per_attr', ! empty($show_product_count_per_attr) );
823
- set_query_var( 'hide_child_attributes', ! empty($hide_child_attributes) );
824
- set_query_var( 'cat_value_limit', ( isset($cat_value_limit) ? $cat_value_limit : null ) );
825
- set_query_var( 'select_first_element_text', ( empty($select_first_element_text) ? __('Any', 'BeRocket_AJAX_domain') : $select_first_element_text ) );
826
- set_query_var( 'icon_before_title', (isset($icon_before_title) ? $icon_before_title : null) );
827
- set_query_var( 'icon_after_title', (isset($icon_after_title) ? $icon_after_title : null) );
828
- set_query_var( 'hide_o_value', ! empty($br_options['hide_value']['o']) );
829
- set_query_var( 'hide_sel_value', ! empty($br_options['hide_value']['sel']) );
830
- set_query_var( 'hide_empty_value', ! empty($br_options['hide_value']['empty']) );
831
- set_query_var( 'hide_button_value', ! empty($br_options['hide_value']['button']) );
832
- set_query_var( 'attribute_count_show_hide', berocket_isset($attribute_count_show_hide) );
833
- set_query_var( 'attribute_count', $attribute_count );
834
- set_query_var( 'description', (isset($description) ? $description : null) );
835
- set_query_var( 'hide_collapse_arrow', (empty($widget_collapse_enable) || ! empty($hide_collapse_arrow)) );
836
- set_query_var( 'values_per_row', (isset($values_per_row) ? $values_per_row : null) );
837
- set_query_var( 'child_parent', (isset($child_parent) ? $child_parent : null) );
838
- set_query_var( 'child_parent_depth', (isset($child_parent_depth) ? $child_parent_depth : null) );
839
- set_query_var( 'product_count_style', (isset($br_options['styles_input']['product_count']) ? $br_options['styles_input']['product_count'] : '').'pcs '.(isset($br_options['styles_input']['product_count_position']) ? $br_options['styles_input']['product_count_position'] : null).'pcs' );
840
- set_query_var( 'child_parent_previous', (isset($child_parent_previous) ? $child_parent_previous : null) );
841
- set_query_var( 'child_parent_no_values', (isset($child_parent_no_values) ? $child_parent_no_values : null) );
842
- set_query_var( 'child_parent_no_products', (isset($child_parent_no_products) ? $child_parent_no_products : null) );
843
- set_query_var( 'before_title', (isset($before_title) ? $before_title : null) );
844
- set_query_var( 'after_title', (isset($after_title) ? $after_title : null) );
845
- set_query_var( 'widget_id', ( $this->id ? $this->id : $widget_id ) );
846
- set_query_var( 'widget_id_number', ( $this->number ? $this->number : $widget_id_number ) );
847
- set_query_var( 'slug_urls', ! empty($br_options['slug_urls']) );
 
848
 
849
  // widget title and start tag ( <ul> ) can be found in templates/widget_start.php
850
  echo $before_widget;
@@ -1028,33 +1040,33 @@ class BeRocket_AAPF_Widget extends WP_Widget {
1028
 
1029
  $wpml_id = preg_replace( '#^pa_#', '', $id );
1030
  $wpml_id = 'pa_'.berocket_wpml_attribute_translate($wpml_id);
1031
- set_query_var( 'slider_value1', $slider_value1 );
1032
- set_query_var( 'slider_value2', $slider_value2 );
1033
- set_query_var( 'filter_slider_id', $wpml_id );
1034
- set_query_var( 'main_class', $main_class );
1035
- set_query_var( 'slider_class', $slider_class );
1036
- set_query_var( 'min', $min );
1037
- set_query_var( 'max', $max );
1038
- set_query_var( 'step', $slider_step );
1039
- set_query_var( 'slider_with_string', $slider_with_string );
1040
- set_query_var( 'all_terms_name', ( empty($all_terms_name) ? null : $all_terms_name ) );
1041
- set_query_var( 'all_terms_slug', ( empty($all_terms_slug) ? null : $all_terms_slug ) );
1042
- set_query_var( 'text_before_price', (isset($text_before_price) ? $text_before_price : null) );
1043
- set_query_var( 'text_after_price', (isset($text_after_price) ? $text_after_price : null) );
1044
- set_query_var( 'enable_slider_inputs', (isset($enable_slider_inputs) ? $enable_slider_inputs : null) );
1045
  if( ! empty($number_style) ) {
1046
- set_query_var( 'number_style', array(
1047
  ( empty($number_style_thousand_separate) ? '' : $number_style_thousand_separate ),
1048
  ( empty($number_style_decimal_separate) ? '' : $number_style_decimal_separate ),
1049
  ( empty($number_style_decimal_number) ? '' : $number_style_decimal_number )
1050
- ));
1051
  } else {
1052
- set_query_var( 'number_style', '' );
1053
  }
1054
  }
1055
- set_query_var( 'first_page_jump', ( empty($first_page_jump) ? '' : $first_page_jump ) );
1056
- set_query_var( 'icon_before_value', (isset($icon_before_value) ? $icon_before_value : null) );
1057
- set_query_var( 'icon_after_value', (isset($icon_after_value) ? $icon_after_value : null) );
1058
 
1059
  if ( $type == 'tag_cloud' ) {
1060
  $tag_script_var = array(
@@ -1064,14 +1076,14 @@ class BeRocket_AAPF_Widget extends WP_Widget {
1064
  'tags_count' => $tag_cloud_tags_count,
1065
  'tags_type' => $tag_cloud_type
1066
  );
1067
- set_query_var( 'tag_script_var', $tag_script_var );
1068
  } elseif ( $type == 'color' || $type == 'image' ) {
1069
- set_query_var( 'use_value_with_color', (isset($use_value_with_color) ? $use_value_with_color : null) );
1070
- set_query_var( 'color_image_block_size', berocket_isset($color_image_block_size, false, 'h2em w2em') );
1071
- set_query_var( 'color_image_checked', berocket_isset($color_image_checked, false, 'brchecked_default') );
1072
- set_query_var( 'color_image_checked_custom_css', berocket_isset($color_image_checked_custom_css) );
1073
- set_query_var( 'color_image_block_size_height', berocket_isset($color_image_block_size_height) );
1074
- set_query_var( 'color_image_block_size_width', berocket_isset($color_image_block_size_width) );
1075
  }
1076
  if( $type == 'select' ) {
1077
  if( ! empty($br_options['use_select2']) ) {
@@ -1082,8 +1094,9 @@ class BeRocket_AAPF_Widget extends WP_Widget {
1082
  }
1083
  wp_enqueue_script( 'select2' );
1084
  }
1085
- set_query_var('select_multiple', ! empty($select_multiple));
1086
  }
 
1087
  br_get_template_part( apply_filters('berocket_widget_load_template_name', $type, $instance, (empty($terms) ? '' : $terms)) );
1088
 
1089
  do_action('berocket_aapf_widget_before_end');
164
  $args['widget_id'] = $this->id;
165
  $this->number = 's'.$berocket_aapf_shortcode_id;
166
  }
167
+ $set_query_var_title = array();
168
+ $set_query_var_main = array();
169
+ $set_query_var_footer = array();
170
  $filter_type_array = array(
171
  'attribute' => array(
172
  'name' => __('Attribute', 'BeRocket_AJAX_domain'),
482
  if( apply_filters( 'berocket_aapf_widget_display_custom_filter', false, berocket_isset($widget_type), $instance, $args, $this ) ) return '';
483
 
484
  if ( ! empty($widget_type) && $widget_type == 'update_button' ) {
485
+ $set_query_var_title = array(
486
+ 'title' => apply_filters( 'berocket_aapf_widget_title', $title ),
487
+ 'uo' => br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ),
488
+ 'is_hide_mobile' => ( empty($is_hide_mobile) ? '' : $is_hide_mobile )
489
+ );
490
+ set_query_var( 'berocket_query_var_title', $set_query_var_title );
491
  echo $before_widget;
492
  br_get_template_part( 'widget_update_button' );
493
  echo $after_widget;
498
  }
499
 
500
  if ( ! empty($widget_type) && $widget_type == 'reset_button' ) {
501
+ $set_query_var_title = array(
502
+ 'title' => apply_filters( 'berocket_aapf_widget_title', $title ),
503
+ 'uo' => br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ),
504
+ 'is_hide_mobile' => ( empty($is_hide_mobile) ? '' : $is_hide_mobile )
505
+ );
506
+ set_query_var( 'berocket_query_var_title', $set_query_var_title );
507
  echo $before_widget;
508
  br_get_template_part( 'widget_reset_button' );
509
  echo $after_widget;
517
  if ( empty($scroll_theme) ) {
518
  $scroll_theme = 'dark';
519
  }
520
+ $set_query_var_title = array(
521
+ 'title' => apply_filters( 'berocket_aapf_widget_title', $title ),
522
+ 'uo' => br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ),
523
+ 'is_hide_mobile' => ( empty($is_hide_mobile) ? '' : $is_hide_mobile ),
524
+ 'selected_area_show' => $selected_area_show,
525
+ 'hide_selected_arrow' => $hide_selected_arrow,
526
+ 'selected_is_hide' => $selected_is_hide,
527
+ );
528
+ set_query_var( 'berocket_query_var_title', $set_query_var_title );
529
  echo $before_widget;
530
  br_get_template_part( 'widget_selected_area' );
531
  echo $after_widget;
554
  $instance['wp_check_product_cat'] = $wp_check_product_cat;
555
  $instance['wp_query_product_cat'] = $wp_query_product_cat;
556
  list($terms_error_return, $terms_ready, $terms, $type) = apply_filters( 'berocket_widget_attribute_type_terms', array(false, false, $terms, $type), $attribute, $filter_type, $instance );
 
557
  if( $terms_ready ) {
558
  if( $terms_error_return === FALSE ) {
559
+ $set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
560
  if( BeRocket_AAPF::$debug_mode ) {
561
  $widget_error_log['terms'] = $terms;
562
  }
613
  if( ! empty( $order_values_type ) && $order_values_type == 'desc' ) {
614
  $terms = array_reverse($terms);
615
  }
616
+ $set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
617
  if( BeRocket_AAPF::$debug_mode ) {
618
  $widget_error_log['terms'] = $terms;
619
  }
671
  $this->restore_wp_the_query($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query);
672
  return false;
673
  }
674
+ $set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
675
  unset( $terms, $terms_unsort );
676
  } else {
677
  $sort_array = array();
714
  if( BeRocket_AAPF::$debug_mode ) {
715
  $widget_error_log['terms'] = $terms;
716
  }
717
+ $set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
718
  }
719
 
720
  } elseif ( $filter_type == 'tag' ) {
741
 
742
  $terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance);
743
 
744
+ $set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
745
 
746
  if ( empty($terms) || ! is_array($terms) || count( $terms ) < 1 ) {
747
  $widget_error_log['terms'] = $terms;
783
  }
784
  $terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance);
785
 
786
+ $set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
787
  $sort_array = self::sort_child_parent_hierarchy($terms);
788
  @ array_multisort( $sort_array, (empty($order_values_type) || $order_values_type == 'asc' ? SORT_ASC : SORT_DESC), SORT_NUMERIC, $terms );
789
 
815
  $values_per_row = 1;
816
  }
817
 
818
+ $set_query_var_title['operator'] = $operator;
819
+ $set_query_var_title['attribute'] = $attribute;
820
+ $set_query_var_title['type'] = $type;
821
+ $set_query_var_title['title'] = apply_filters( 'berocket_aapf_widget_title', $title );
822
+ $set_query_var_title['class'] = apply_filters( 'berocket_aapf_widget_class', $class );
823
+ $set_query_var_title['css_class'] = apply_filters( 'berocket_aapf_widget_css_class', (isset($css_class) ? $css_class : '') );
824
+ $set_query_var_title['style'] = apply_filters( 'berocket_aapf_widget_style', $style );
825
+ $set_query_var_title['scroll_theme'] = $scroll_theme;
826
+ $set_query_var_title['x'] = time();
827
+ $set_query_var_title['filter_type'] = $filter_type;
828
+ $set_query_var_title['uo'] = br_aapf_converter_styles( (empty($br_options['styles']) ? '' : $br_options['styles']) );
829
+ $set_query_var_title['notuo'] = (empty($br_options['styles']) ? '' : $br_options['styles']);
830
+ $set_query_var_title['widget_is_hide'] = (! empty($widget_collapse_enable) && ! empty($widget_is_hide));
831
+ $set_query_var_title['widget_collapse_disable'] = empty($widget_collapse_enable);
832
+ $set_query_var_title['is_hide_mobile'] = ! empty($is_hide_mobile);
833
+ $set_query_var_title['show_product_count_per_attr'] = ! empty($show_product_count_per_attr);
834
+ $set_query_var_title['hide_child_attributes'] = ! empty($hide_child_attributes);
835
+ $set_query_var_title['cat_value_limit'] = ( isset($cat_value_limit) ? $cat_value_limit : null );
836
+ $set_query_var_title['select_first_element_text'] = ( empty($select_first_element_text) ? __('Any', 'BeRocket_AJAX_domain') : $select_first_element_text );
837
+ $set_query_var_title['icon_before_title'] = (isset($icon_before_title) ? $icon_before_title : null);
838
+ $set_query_var_title['icon_after_title'] = (isset($icon_after_title) ? $icon_after_title : null);
839
+ $set_query_var_title['hide_o_value'] = ! empty($br_options['hide_value']['o']);
840
+ $set_query_var_title['hide_sel_value'] = ! empty($br_options['hide_value']['sel']);
841
+ $set_query_var_title['hide_empty_value'] = ! empty($br_options['hide_value']['empty']);
842
+ $set_query_var_title['hide_button_value'] = ! empty($br_options['hide_value']['button']);
843
+ $set_query_var_title['attribute_count_show_hide'] = berocket_isset($attribute_count_show_hide);
844
+ $set_query_var_title['attribute_count'] = $attribute_count;
845
+ $set_query_var_title['description'] = (isset($description) ? $description : null);
846
+ $set_query_var_title['hide_collapse_arrow'] = (empty($widget_collapse_enable) || ! empty($hide_collapse_arrow));
847
+ $set_query_var_title['values_per_row'] = (isset($values_per_row) ? $values_per_row : null);
848
+ $set_query_var_title['child_parent'] = (isset($child_parent) ? $child_parent : null);
849
+ $set_query_var_title['child_parent_depth'] = (isset($child_parent_depth) ? $child_parent_depth : null);
850
+ $set_query_var_title['product_count_style'] = (isset($br_options['styles_input']['product_count']) ? $br_options['styles_input']['product_count'] : '').'pcs '.(isset($br_options['styles_input']['product_count_position']) ? $br_options['styles_input']['product_count_position'] : null).'pcs';
851
+ $set_query_var_title['child_parent_previous'] = (isset($child_parent_previous) ? $child_parent_previous : null);
852
+ $set_query_var_title['child_parent_no_values'] = (isset($child_parent_no_values) ? $child_parent_no_values : null);
853
+ $set_query_var_title['child_parent_no_products'] = (isset($child_parent_no_products) ? $child_parent_no_products : null);
854
+ $set_query_var_title['before_title'] = (isset($before_title) ? $before_title : null);
855
+ $set_query_var_title['after_title'] = (isset($after_title) ? $after_title : null);
856
+ $set_query_var_title['widget_id'] = ( $this->id ? $this->id : $widget_id );
857
+ $set_query_var_title['widget_id_number'] = ( $this->number ? $this->number : $widget_id_number );
858
+ $set_query_var_title['slug_urls'] = ! empty($br_options['slug_urls']);
859
+ set_query_var( 'berocket_query_var_title', $set_query_var_title );
860
 
861
  // widget title and start tag ( <ul> ) can be found in templates/widget_start.php
862
  echo $before_widget;
1040
 
1041
  $wpml_id = preg_replace( '#^pa_#', '', $id );
1042
  $wpml_id = 'pa_'.berocket_wpml_attribute_translate($wpml_id);
1043
+ $set_query_var_title['slider_value1'] = $slider_value1;
1044
+ $set_query_var_title['slider_value2'] = $slider_value2;
1045
+ $set_query_var_title['filter_slider_id'] = $wpml_id;
1046
+ $set_query_var_title['main_class'] = $main_class;
1047
+ $set_query_var_title['slider_class'] = $slider_class;
1048
+ $set_query_var_title['min'] = $min;
1049
+ $set_query_var_title['max'] = $max;
1050
+ $set_query_var_title['step'] = $slider_step;
1051
+ $set_query_var_title['slider_with_string'] = $slider_with_string;
1052
+ $set_query_var_title['all_terms_name'] = ( empty($all_terms_name) ? null : $all_terms_name );
1053
+ $set_query_var_title['all_terms_slug'] = ( empty($all_terms_slug) ? null : $all_terms_slug );
1054
+ $set_query_var_title['text_before_price'] = (isset($text_before_price) ? $text_before_price : null);
1055
+ $set_query_var_title['text_after_price'] = (isset($text_after_price) ? $text_after_price : null);
1056
+ $set_query_var_title['enable_slider_inputs'] = (isset($enable_slider_inputs) ? $enable_slider_inputs : null);
1057
  if( ! empty($number_style) ) {
1058
+ $set_query_var_title['number_style'] = array(
1059
  ( empty($number_style_thousand_separate) ? '' : $number_style_thousand_separate ),
1060
  ( empty($number_style_decimal_separate) ? '' : $number_style_decimal_separate ),
1061
  ( empty($number_style_decimal_number) ? '' : $number_style_decimal_number )
1062
+ );
1063
  } else {
1064
+ $set_query_var_title['number_style'] = '';
1065
  }
1066
  }
1067
+ $set_query_var_title['first_page_jump'] = ( empty($first_page_jump) ? '' : $first_page_jump );
1068
+ $set_query_var_title['icon_before_value'] = (isset($icon_before_value) ? $icon_before_value : null);
1069
+ $set_query_var_title['icon_after_value'] = (isset($icon_after_value) ? $icon_after_value : null);
1070
 
1071
  if ( $type == 'tag_cloud' ) {
1072
  $tag_script_var = array(
1076
  'tags_count' => $tag_cloud_tags_count,
1077
  'tags_type' => $tag_cloud_type
1078
  );
1079
+ $set_query_var_title['tag_script_var'] = $tag_script_var;
1080
  } elseif ( $type == 'color' || $type == 'image' ) {
1081
+ $set_query_var_title['use_value_with_color'] = (isset($use_value_with_color) ? $use_value_with_color : null);
1082
+ $set_query_var_title['color_image_block_size'] = berocket_isset($color_image_block_size, false, 'h2em w2em');
1083
+ $set_query_var_title['color_image_checked'] = berocket_isset($color_image_checked, false, 'brchecked_default');
1084
+ $set_query_var_title['color_image_checked_custom_css'] = berocket_isset($color_image_checked_custom_css);
1085
+ $set_query_var_title['color_image_block_size_height'] = berocket_isset($color_image_block_size_height);
1086
+ $set_query_var_title['color_image_block_size_width'] = berocket_isset($color_image_block_size_width);
1087
  }
1088
  if( $type == 'select' ) {
1089
  if( ! empty($br_options['use_select2']) ) {
1094
  }
1095
  wp_enqueue_script( 'select2' );
1096
  }
1097
+ $set_query_var_title['select_multiple'] = ! empty($select_multiple);
1098
  }
1099
+ set_query_var( 'berocket_query_var_title', $set_query_var_title );
1100
  br_get_template_part( apply_filters('berocket_widget_load_template_name', $type, $instance, (empty($terms) ? '' : $terms)) );
1101
 
1102
  do_action('berocket_aapf_widget_before_end');
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://berocket.com/product/woocommerce-ajax-products-filter
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
  Tested up to: 5.1.1
8
- Stable tag: 1.3.1.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -187,6 +187,11 @@ You can try this plugin's admin side [here](http://berocket.com/product/woocomme
187
 
188
  == Changelog ==
189
 
 
 
 
 
 
190
  = 1.3.1.7 =
191
  * Enhancement - Code Security
192
 
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
  Tested up to: 5.1.1
8
+ Stable tag: 1.3.1.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
187
 
188
  == Changelog ==
189
 
190
+ = 1.3.1.8 =
191
+ * Enhancement - Compatibility with Elementor and other plugins
192
+ * Enhancement - Compatibility with other BeRocket plugins
193
+ * Enhancement - Code Security
194
+
195
  = 1.3.1.7 =
196
  * Enhancement - Code Security
197
 
templates/checkbox.php CHANGED
@@ -10,6 +10,7 @@
10
  */
11
  ?>
12
  <?php
 
13
  global $berocket_unique_value;
14
  $berocket_unique_value++;
15
  $random_name = strval($berocket_unique_value);
10
  */
11
  ?>
12
  <?php
13
+ extract($berocket_query_var_title);
14
  global $berocket_unique_value;
15
  $berocket_unique_value++;
16
  $random_name = strval($berocket_unique_value);
templates/color.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  global $berocket_unique_value;
3
  $berocket_unique_value++;
4
  $random_name = strval($berocket_unique_value);
1
  <?php
2
+ extract($berocket_query_var_title);
3
  global $berocket_unique_value;
4
  $berocket_unique_value++;
5
  $random_name = strval($berocket_unique_value);
templates/disabled/checkbox.php CHANGED
@@ -10,6 +10,7 @@
10
  */
11
  ?>
12
  <?php
 
13
  global $berocket_unique_value;
14
  $berocket_unique_value++;
15
  $random_name = strval($berocket_unique_value);
10
  */
11
  ?>
12
  <?php
13
+ extract($berocket_query_var_title);
14
  global $berocket_unique_value;
15
  $berocket_unique_value++;
16
  $random_name = strval($berocket_unique_value);
templates/disabled/color.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  global $berocket_unique_value;
3
  $berocket_unique_value++;
4
  $random_name = strval($berocket_unique_value);
1
  <?php
2
+ extract($berocket_query_var_title);
3
  global $berocket_unique_value;
4
  $berocket_unique_value++;
5
  $random_name = strval($berocket_unique_value);
templates/disabled/radio.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  global $berocket_unique_value;
3
  $berocket_unique_value++;
4
  $random_name = strval($berocket_unique_value);
1
  <?php
2
+ extract($berocket_query_var_title);
3
  global $berocket_unique_value;
4
  $berocket_unique_value++;
5
  $random_name = strval($berocket_unique_value);
templates/disabled/select.php CHANGED
@@ -8,6 +8,7 @@
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
 
11
  global $berocket_unique_value;
12
  $berocket_unique_value++;
13
  $random_name = strval($berocket_unique_value);
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
11
+ extract($berocket_query_var_title);
12
  global $berocket_unique_value;
13
  $berocket_unique_value++;
14
  $random_name = strval($berocket_unique_value);
templates/disabled/slider.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  global $berocket_unique_value;
3
  $berocket_unique_value++;
4
  $unique = strval($berocket_unique_value);
1
  <?php
2
+ extract($berocket_query_var_title);
3
  global $berocket_unique_value;
4
  $berocket_unique_value++;
5
  $unique = strval($berocket_unique_value);
templates/disabled/tag_cloud.php CHANGED
@@ -8,6 +8,7 @@
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
 
11
  $term_i = 0;
12
  foreach ( $terms as $term ) { ?>
13
  <li title="<?php echo $term->count; ?>" class="berocket_tag_cloud_element berocket_disabled_filter_element">
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
11
+ extract($berocket_query_var_title);
12
  $term_i = 0;
13
  foreach ( $terms as $term ) { ?>
14
  <li title="<?php echo $term->count; ?>" class="berocket_tag_cloud_element berocket_disabled_filter_element">
templates/radio.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  global $berocket_unique_value;
3
  $berocket_unique_value++;
4
  $random_name = strval($berocket_unique_value);
1
  <?php
2
+ extract($berocket_query_var_title);
3
  global $berocket_unique_value;
4
  $berocket_unique_value++;
5
  $random_name = strval($berocket_unique_value);
templates/select.php CHANGED
@@ -8,6 +8,7 @@
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
 
11
  global $berocket_unique_value;
12
  $berocket_unique_value++;
13
  $random_name = strval($berocket_unique_value);
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
11
+ extract($berocket_query_var_title);
12
  global $berocket_unique_value;
13
  $berocket_unique_value++;
14
  $random_name = strval($berocket_unique_value);
templates/slider.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  global $berocket_unique_value;
3
  $berocket_unique_value++;
4
  $unique = strval($berocket_unique_value);
1
  <?php
2
+ extract($berocket_query_var_title);
3
  global $berocket_unique_value;
4
  $berocket_unique_value++;
5
  $unique = strval($berocket_unique_value);
templates/tag_cloud.php CHANGED
@@ -8,6 +8,7 @@
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
 
11
  $term_i = 0;
12
  foreach ( $terms as $term ) { ?>
13
  <li title="<?php echo $term->count; ?>" class="berocket_tag_cloud_element">
8
  * @package WooCommerce-Filters/Templates
9
  * @version 1.0.1
10
  */
11
+ extract($berocket_query_var_title);
12
  $term_i = 0;
13
  foreach ( $terms as $term ) { ?>
14
  <li title="<?php echo $term->count; ?>" class="berocket_tag_cloud_element">
templates/widget_reset_button.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="berocket_aapf_widget">
2
  <input value="<?php echo berocket_isset($title) ?>" class="berocket_aapf_reset_button<?php if ( ! empty($is_hide_mobile) ) echo ' berocket_aapf_hide_mobile' ?>" type="button" />
3
  </div>
1
+ <?php extract($berocket_query_var_title); ?>
2
  <div class="berocket_aapf_widget">
3
  <input value="<?php echo berocket_isset($title) ?>" class="berocket_aapf_reset_button<?php if ( ! empty($is_hide_mobile) ) echo ' berocket_aapf_hide_mobile' ?>" type="button" />
4
  </div>
templates/widget_selected_area.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="<?php echo ( ! empty($is_hooked) ? 'berocket_aapf_selected_area_hook' : 'berocket_aapf_widget-wrapper' ); ?> berocket_aapf_selected_area_block">
2
  <?php if ( empty($is_hooked) ) { ?>
3
  <div class="berocket_aapf_widget-title_div<?php if ( ! empty($is_hide_mobile) ) echo ' berocket_aapf_hide_mobile' ?>">
1
+ <?php extract($berocket_query_var_title); ?>
2
  <div class="<?php echo ( ! empty($is_hooked) ? 'berocket_aapf_selected_area_hook' : 'berocket_aapf_widget-wrapper' ); ?> berocket_aapf_selected_area_block">
3
  <?php if ( empty($is_hooked) ) { ?>
4
  <div class="berocket_aapf_widget-title_div<?php if ( ! empty($is_hide_mobile) ) echo ' berocket_aapf_hide_mobile' ?>">
templates/widget_start.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  $child_parent = berocket_isset($child_parent);
3
  $is_child = $child_parent == 'child';
4
  $is_child_parent = in_array($child_parent, array('child', 'parent'));
1
  <?php
2
+ extract($berocket_query_var_title);
3
  $child_parent = berocket_isset($child_parent);
4
  $is_child = $child_parent == 'child';
5
  $is_child_parent = in_array($child_parent, array('child', 'parent'));
templates/widget_update_button.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="berocket_aapf_widget">
2
  <input value="<?php echo berocket_isset($title) ?>" class="berocket_aapf_widget_update_button<?php if ( ! empty($is_hide_mobile) ) echo ' berocket_aapf_hide_mobile' ?>" type="button" />
3
  </div>
1
+ <?php extract($berocket_query_var_title); ?>
2
  <div class="berocket_aapf_widget">
3
  <input value="<?php echo berocket_isset($title) ?>" class="berocket_aapf_widget_update_button<?php if ( ! empty($is_hide_mobile) ) echo ' berocket_aapf_hide_mobile' ?>" type="button" />
4
  </div>
woocommerce-filters.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
- * Version: 1.3.1.7
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: http://berocket.com
@@ -13,6 +13,6 @@
13
  * Domain Path: /languages/
14
  * WC tested up to: 3.5.7
15
  */
16
- define( "BeRocket_AJAX_filters_version", '1.3.1.7' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
+ * Version: 1.3.1.8
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: http://berocket.com
13
  * Domain Path: /languages/
14
  * WC tested up to: 3.5.7
15
  */
16
+ define( "BeRocket_AJAX_filters_version", '1.3.1.8' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');