YITH WooCommerce Ajax Product Filter - Version 3.1.0

Version Description

  • Released: 05 December, 2016 =

  • Added: Support to WordPress 4.7

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.12 to 3.1.0

README.txt CHANGED
@@ -3,8 +3,8 @@
3
Contributors: yithemes
4
Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
Requires at least: 4.0
6
- Tested up to: 4.6.1
7
- Stable tag: 3.0.12
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -159,6 +159,10 @@ If you want to see a demonstration version of the premium plugin, you can see it
159
160
== Changelog ==
161
162
= 3.0.12 - Released: 23 November, 2016 =
163
164
* Fixed: Url management with query type set to OR
@@ -495,4 +499,4 @@ New plugin core added.
495
496
= 1.0.0 =
497
498
- Initial release
3
Contributors: yithemes
4
Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
Requires at least: 4.0
6
+ Tested up to: 4.7
7
+ Stable tag: 3.1.0
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
159
160
== Changelog ==
161
162
+ = 3.1.0 - Released: 05 December, 2016 =
163
+
164
+ * Added: Support to WordPress 4.7
165
+
166
= 3.0.12 - Released: 23 November, 2016 =
167
168
* Fixed: Url management with query type set to OR
499
500
= 1.0.0 =
501
502
+ Initial release
includes/class.yith-wcan-frontend.php CHANGED
@@ -92,8 +92,12 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
92
* @return the query object
93
*/
94
public function select_query_object( $current_wp_query ){
95
global $wp_the_query;
96
- return apply_filters( 'yith_wcan_use_wp_the_query_object', false ) ? $wp_the_query->query : $current_wp_query->query;
97
}
98
99
/**
92
* @return the query object
93
*/
94
public function select_query_object( $current_wp_query ){
95
+ /**
96
+ * For WordPress 4.7 Must use WP_Query object
97
+ */
98
global $wp_the_query;
99
+ $use_wp_query = YITH_WCAN()->is_wp_older_4_7 ? false : true;
100
+ return apply_filters( 'yith_wcan_use_wp_the_query_object', $use_wp_query ) ? $wp_the_query->query : $current_wp_query->query;
101
}
102
103
/**
includes/class.yith-wcan.php CHANGED
@@ -53,12 +53,13 @@ if ( ! class_exists( 'YITH_WCAN' ) ) {
53
protected static $_instance = null;
54
55
/**
56
- * @var bool Check for old WooCommerce Version
57
* @since 3.0
58
*/
59
public $current_wc_version = false;
60
public $is_wc_older_2_1 = false;
61
public $is_wc_older_2_6 = false;
62
63
/**
64
* @var string filtered term fields
@@ -85,6 +86,12 @@ if ( ! class_exists( 'YITH_WCAN' ) ) {
85
$this->is_wc_older_2_1 = version_compare( $this->current_wc_version, '2.1', '<' );
86
$this->is_wc_older_2_6 = version_compare( $this->current_wc_version, '2.6', '<' );
87
88
if( $this->is_wc_older_2_6 ){
89
$this->filter_term_field = 'term_id';
90
}
53
protected static $_instance = null;
54
55
/**
56
+ * @var bool Check for old WooCommerce/WordPress Version
57
* @since 3.0
58
*/
59
public $current_wc_version = false;
60
public $is_wc_older_2_1 = false;
61
public $is_wc_older_2_6 = false;
62
+ public $is_wp_older_4_7 = false;
63
64
/**
65
* @var string filtered term fields
86
$this->is_wc_older_2_1 = version_compare( $this->current_wc_version, '2.1', '<' );
87
$this->is_wc_older_2_6 = version_compare( $this->current_wc_version, '2.6', '<' );
88
89
+ /**
90
+ * WordPress Version Check
91
+ */
92
+ global $wp_version;
93
+ $this->is_wp_older_4_7 = version_compare( $wp_version, '4.7-RC1', '<' );
94
+
95
if( $this->is_wc_older_2_6 ){
96
$this->filter_term_field = 'term_id';
97
}
init.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: YITH WooCommerce Ajax Product Filter
4
* Plugin URI: http://yithemes.com/
5
* Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 3.0.12
7
* Author: YITHEMES
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-woocommerce-ajax-navigation
@@ -64,7 +64,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
64
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.12' );
68
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
3
* Plugin Name: YITH WooCommerce Ajax Product Filter
4
* Plugin URI: http://yithemes.com/
5
* Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 3.1.0
7
* Author: YITHEMES
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-woocommerce-ajax-navigation
64
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.1.0' );
68
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/**
3
* Framework Name: YIT Plugin Framework
4
- * Version: 2.9.39
5
* Author: Yithemes
6
* Text Domain: yith-plugin-fw
7
* Domain Path: /languages/
@@ -19,7 +19,6 @@
19
* http://www.gnu.org/licenses/gpl-3.0.txt
20
*/
21
22
-
23
if ( ! defined ( 'ABSPATH' ) ) {
24
exit;
25
} // Exit if accessed directly
1
<?php
2
/**
3
* Framework Name: YIT Plugin Framework
4
+ * Version: 2.9.40
5
* Author: Yithemes
6
* Text Domain: yith-plugin-fw
7
* Domain Path: /languages/
19
* http://www.gnu.org/licenses/gpl-3.0.txt
20
*/
21
22
if ( ! defined ( 'ABSPATH' ) ) {
23
exit;
24
} // Exit if accessed directly
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -369,7 +369,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
369
wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
370
371
wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
372
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen','wp-color-picker' ), $this->version, true );
373
wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
374
'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
375
) );
369
wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
370
371
wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
372
+ wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen','wp-color-picker', 'jquery-ui-dialog' ), $this->version, true );
373
wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
374
'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
375
) );
widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -86,7 +86,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
86
if ( ! taxonomy_exists( $taxonomy ) ) {
87
return;
88
}
89
-
90
$terms = yit_get_terms( $terms_type_list, $taxonomy, $instance );
91
92
if ( count( $terms ) > 0 ) {
@@ -676,7 +676,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
676
// End display type conditional
677
678
echo $after_widget;
679
-
680
if ( ! $this->found ) {
681
ob_end_clean();
682
}
@@ -1057,7 +1057,9 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
1057
}
1058
1059
else {
1060
- ! $filter_by_tags_hierarchical && $query_type != 'and' && printf( '<li %s><span>%s</span>', $class, $term->name );
1061
$li_printed = true;
1062
}
1063
86
if ( ! taxonomy_exists( $taxonomy ) ) {
87
return;
88
}
89
+
90
$terms = yit_get_terms( $terms_type_list, $taxonomy, $instance );
91
92
if ( count( $terms ) > 0 ) {
676
// End display type conditional
677
678
echo $after_widget;
679
+
680
if ( ! $this->found ) {
681
ob_end_clean();
682
}
1057
}
1058
1059
else {
1060
+ $to_print = apply_filters( 'yith_wcan_hide_no_products_attributes', ! $filter_by_tags_hierarchical && $query_type != 'and' );
1061
+
1062
+ $to_print && printf( '<li %s><span>%s</span>', $class, $term->name );
1063
$li_printed = true;
1064
}
1065