From 5e529d45fedc8a95f0fbfbe5f96cd01fa3b816c1 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 17:10:28 +0600 Subject: [PATCH] WavePlayer Compatibility features Added --- includes/functions.php | 34 +++++++++++++++++++++++++++++++++- includes/shortcode.php | 2 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 166604ff..deb5c63e 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1331,4 +1331,36 @@ function wpt_shop_archive_sorting_args( $args ){ * @date 3.2.2021 * @by Saiful */ -add_filter( 'astra_add_to_cart_quantity_btn_enabled', '__return_false' ); \ No newline at end of file +add_filter( 'astra_add_to_cart_quantity_btn_enabled', '__return_false' ); + + + +if( !function_exists( 'wpt_ajax_on_first_load' ) ){ + /** + * Compability Code for WavePlayer + * + * We actually added this code for + * WavePlayer + * + * Because, + * If u want to enable this code, u have to use following ACTION HOOK to your theme/plugin + * Also can use CodeSnipet Plugin. + * + * Hook is: + * add_action( 'wp_footer', 'wpt_ajax_on_first_load', 100 ); + * + * CodeSnippet Plugin URL: https://wordpress.org/plugins/code-snippets/ + */ + function wpt_ajax_on_first_load(){ + +$output = << +jQuery(document).ready(function($){ + $("button.wpt_search_button").trigger("click"); +}); + +EOT; + echo $output; + } +} +//add_action( 'wp_footer', 'wpt_ajax_on_first_load', 100 ); \ No newline at end of file diff --git a/includes/shortcode.php b/includes/shortcode.php index 160301bb..87f06e0e 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -535,6 +535,8 @@ function wpt_shortcode_generator( $atts = false ) { * @date 9.6.2018 d.m.y */ $html .= wpt_search_box( $temp_number, $texonomiy_keywords, $sort_order_by, $sort, $search_n_filter,$table_ID ); + }else{ + $html .= ''; } $html .= apply_filters('end_part_advance_search_box_abc','',$table_ID,$temp_number); /**