Skip to content

Commit

Permalink
Release new version 5.8.3
Browse files Browse the repository at this point in the history
= 5.8.3 - 2023/08/08 =
* This maintenance release has tweaks and bug fixes for compatibility with WordPress 6.3.0 and WooCommerce 7.9.0
* Tweak - Test for compatibility with WooCommerce 7.9.0
* Tweak - Test for compatibility with WordPress 6.3
* Fix - Make the navigation template from Search Result page show correct for theme support FSE
  • Loading branch information
alextuan committed Aug 8, 2023
1 parent 1229b2a commit 16b9c5f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
13 changes: 8 additions & 5 deletions classes/class-wc-predictive-search-backbone.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
class Hook_Backbone
{
public function __construct() {

// Add script into footer to hanlde the event from widget, popup
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_scripts' ), 11 );
add_action( 'wp_enqueue_scripts', array( $this, 'include_result_shortcode_script' ), 12 );

if ( ! wcps_current_theme_is_fse_theme() ) {
add_action( 'wp_enqueue_scripts', array( $this, 'include_result_shortcode_script' ), 12 );
}

// Include google fonts into header
add_action( 'wp_enqueue_scripts', array( $this, 'add_google_fonts'), 9 );
Expand Down Expand Up @@ -117,12 +120,12 @@ public function register_plugin_scripts() {
) )
);
}
public function include_result_shortcode_script() {

public function include_result_shortcode_script() {
global $wp_query;
global $post;
global $woocommerce_search_page_id;

if ( $post && $post->ID != $woocommerce_search_page_id ) return '';

$current_lang = '';
Expand Down
5 changes: 5 additions & 0 deletions classes/class-wc-predictive-search-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ public static function parse_shortcode_search_result($attributes) {
// Don't show content for shortcode on Dashboard, still support for admin ajax
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) return;

if ( wcps_current_theme_is_fse_theme() ) {
global $wc_ps_hook_backbone;
$wc_ps_hook_backbone->include_result_shortcode_script();
}

$search_results = '';
global $woocommerce_search_page_id;
global $wp_query;
Expand Down
13 changes: 11 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Contributors: a3rev, nguyencongtuan
Tags: WooCommerce search, Predictive Search, WooCommerce, Predictive Search, Live Search, Elementor WooCommerce Search
Requires at least: 6.0
Tested up to: 6.2
Stable tag: 5.8.2
Tested up to: 6.3
Stable tag: 5.8.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -182,6 +182,12 @@ You can use this plugin only when you have installed the WooCommerce plugin.

== Changelog ==

= 5.8.3 - 2023/08/08 =
* This maintenance release has tweaks and bug fixes for compatibility with WordPress 6.3.0 and WooCommerce 7.9.0
* Tweak - Test for compatibility with WooCommerce 7.9.0
* Tweak - Test for compatibility with WordPress 6.3
* Fix - Make the navigation template from Search Result page show correct for theme support FSE

= 5.8.2 - 2023/05/16 =
* This release has an Uncaught Error bug fix that surfaced in yesterdays release.
* Fix - Called wp_create_nonce from plugin settings after plugins loaded
Expand Down Expand Up @@ -1054,6 +1060,9 @@ You can use this plugin only when you have installed the WooCommerce plugin.

== Upgrade Notice ==

= 5.8.3 =
This maintenance release has tweaks and bug fixes for compatibility with WordPress 6.3.0 and WooCommerce 7.9.0

= 5.8.2 =
This release has an Uncaught Error bug fix that surfaced in yesterdays release.

Expand Down
4 changes: 2 additions & 2 deletions templates/results-page/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
?>

<?php if ( count( $ps_search_list ) > 0 ) { ?>
<?php if ( ! empty( $ps_search_list ) && count( $ps_search_list ) > 0 ) { ?>
<p class="rs_result_heading">
<?php wc_ps_ict_t_e( 'Viewing all', __('Viewing all', 'woocommerce-predictive-search' ) ); ?>
<strong><span class="ps_heading_search_in_name"><?php echo $items_search_default[$ps_current_search_in]['name']; ?></span></strong>
Expand All @@ -18,7 +18,7 @@
<?php } ?>

<?php
if ( count( $ps_search_list ) > 1 ) {
if ( ! empty( $ps_search_list ) && count( $ps_search_list ) > 1 ) {
if ( $permalink_structure == '')
$other_link_search = get_permalink( $woocommerce_search_page_id ).'&rs='. urlencode($search_keyword);
else
Expand Down
19 changes: 15 additions & 4 deletions wc-predictive-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Plugin Name: Predictive Search for WooCommerce
Plugin URI: https://a3rev.com/shop/woocommerce-predictive-search/
Description: With WooCommerce Predictive Search Lite you can add an awesome Predictive Products Search widget to any widgetized area on your site.
Version: 5.8.2
Version: 5.8.3
Author: a3rev Software
Author URI: https://www.a3rev.com/
Requires at least: 5.6
Tested up to: 6.2
Tested up to: 6.3
Text Domain: woocommerce-predictive-search
WC requires at least: 3.0.0
WC tested up to: 7.7
WC tested up to: 7.9
Domain Path: /languages
License: GPLv2 or later
Expand Down Expand Up @@ -41,9 +41,20 @@

define( 'WOOPS_KEY', 'woo_predictive_search' );
define( 'WOOPS_PREFIX', 'wc_predictive_search_' );
define( 'WOOPS_VERSION', '5.8.2' );
define( 'WOOPS_VERSION', '5.8.3' );
define( 'WOOPS_G_FONTS', true );

function wcps_current_theme_is_fse_theme() {
if ( function_exists( 'wp_is_block_theme' ) ) {
return (bool) wp_is_block_theme();
}
if ( function_exists( 'gutenberg_is_fse_theme' ) ) {
return (bool) gutenberg_is_fse_theme();
}

return false;
}

// declare compatibility with new HPOS of WooCommerce
add_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
Expand Down

0 comments on commit 16b9c5f

Please sign in to comment.