diff --git a/README.txt b/README.txt index 6ab4305..13ae32f 100644 --- a/README.txt +++ b/README.txt @@ -5,7 +5,7 @@ Tags: Chat, Click to Chat, Facebook Messenger, WhatsApp, Telegram, Whatsapp Busi Requires at least: 3.5.0 Tested up to: 5.9 Requires PHP: 5.3 -Stable tag: 4.4.1 +Stable tag: 4.4.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -256,6 +256,8 @@ If your site don't have standard names for UA tracker ('ga') or data layer ('dat return $settings; } );` +Joinchat is compatible with plugins **MonsterInsights – Google Analytics Dashboard for WordPress** and **Google Tag Manager for WordPress** custom names. + = Google Tag Manager integration = Join.chat sends a `'JoinChat'` event if GTM is detected when user launch WhatsApp: @@ -329,6 +331,14 @@ Join.chat save two localStorage variables for proper operation: == Changelog == += 4.4.2 = +* **NEW Optimized CSS** for only button without Call to Action (only 2.5kB). +* **NEW** Compatible with **Perfect Brands for WooCommerce** for brand custom settings. +* **NEW** Compatible with **Google Tag Manager for WordPress** custom DataLayer name. +* **NEW** Don't load on Elementor Site Builder previews. +* FIX badge animation don't show error introduced in v4.4.0. +* CHANGED optimized render without unused elements. + = 4.4.1 = * FIX Google Ads conversion field is too short. diff --git a/admin/class-joinchat-woo-admin.php b/admin/class-joinchat-woo-admin.php index 3df9c43..eeede03 100644 --- a/admin/class-joinchat-woo-admin.php +++ b/admin/class-joinchat-woo-admin.php @@ -36,6 +36,11 @@ public function init( $joinchat ) { $loader->add_filter( 'joinchat_help_tab_styles_and_vars', $this, 'help_tab_vars' ); $loader->add_filter( 'joinchat_metabox_vars', $this, 'metabox_vars', 10, 2 ); $loader->add_filter( 'joinchat_metabox_placeholders', $this, 'metabox_placeholders', 10, 3 ); + + if ( defined( 'PWB_PLUGIN_FILE' ) ) { // Perfect Brands for WooCommerce + $loader->add_filter( 'joinchat_term_metabox_output', $this, 'term_metabox_fix', 10, 4 ); + } + } /** @@ -129,7 +134,13 @@ public function custom_post_types( $custom_post_types ) { */ public function custom_taxonomies( $taxonomies ) { - return array_merge( $taxonomies, array( 'product_cat', 'product_tag' ) ); + $product_taxs = array( 'product_cat', 'product_tag' ); + + if ( defined( 'PWB_PLUGIN_FILE' ) ) { + $product_taxs[] = 'pwb-brand'; + } + + return array_merge( $taxonomies, $product_taxs ); } @@ -375,7 +386,6 @@ public function metabox_vars( $vars, $obj ) { return $vars; } - /** * Add Product metabox placeholders info. * @@ -401,4 +411,24 @@ public function metabox_placeholders( $placeholders, $obj, $settings ) { return $placeholders; } + + /** + * Fix term meteabox for Brands + * + * @since 4.4.2 + * @param string $metabox_output + * @param WP_Term $term Current taxonomy term object + * @param array $metadata + * @param string $taxonomy Current taxonomy slug + * @return string + */ + public function term_metabox_fix( $metabox_output, $term, $metadata, $taxonomy ) { + + if ( 'pwb-brand' === $taxonomy ) { + $metabox_output = '