diff --git a/CHANGELOG.md b/CHANGELOG.md index 88f9656..ace8500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2024-08-26 4.8.2 +* Fixed base file customization issue +* Added a hook to update the list of meta fields + ## 2024-08-06 4.8.1 * Fix filtering of api query results diff --git a/VERSION b/VERSION index 697e993..326ec63 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.8.1 +4.8.2 diff --git a/doc/3. Customization/Filters.md b/doc/3. Customization/Filters.md index 0aecc33..8af43da 100644 --- a/doc/3. Customization/Filters.md +++ b/doc/3. Customization/Filters.md @@ -46,6 +46,8 @@ > retailcrm_order_update_after - позволяет проверить изменение заказа и произвести дополнительные действия +> retailcrm_change_default_meta_fields - позволяет изменить список получаемых по умолчанию мета-полей + **Пример использования:** ```php get_admin_url()]; - $jsScriptsPath = plugins_url() . '/woo-retailcrm/assets/js/'; + $jsScriptsPath = plugins_url() . self::ASSETS_DIR . '/js/'; foreach ($jsScripts as $scriptName) { wp_register_script($scriptName, $jsScriptsPath . $scriptName . '.js', false, '0.1'); @@ -861,7 +863,7 @@ if (!class_exists('WC_Retailcrm_Base')) { */ public function include_whatsapp_icon_style() { - wp_register_style('whatsapp_icon_style', plugins_url() . '/woo-retailcrm/assets/css/whatsapp-icon.min.css', false, '0.1'); + wp_register_style('whatsapp_icon_style', plugins_url() . self::ASSETS_DIR . '/css/whatsapp-icon.min.css', false, '0.1'); wp_enqueue_style('whatsapp_icon_style'); } @@ -1018,8 +1020,8 @@ if (!class_exists('WC_Retailcrm_Base')) { $jsScript = 'retailcrm-loyalty-actions'; $loyaltyUrl = ['url' => get_admin_url()]; - $jsScriptsPath = plugins_url() . '/woo-retailcrm/assets/js/'; - $cssPath = plugins_url() . '/woo-retailcrm/assets/css/'; + $jsScriptsPath = plugins_url() . self::ASSETS_DIR . '/js/'; + $cssPath = plugins_url() . self::ASSETS_DIR . '/css/'; $messagePhone = __('Enter the correct phone number', 'retailcrm'); wp_register_script($jsScript, $jsScriptsPath . $jsScript . '.js', false, '0.1'); @@ -1082,7 +1084,7 @@ if (!class_exists('WC_Retailcrm_Base')) { $metaData = ['default_retailcrm' => __('Select value', 'retailcrm')]; $sqlQuery = "SELECT DISTINCT `meta_key` FROM $table ORDER BY `meta_key`"; $defaultMetaFields = file( - __DIR__ . '/../assets/default/default_meta_fields.txt', + WP_PLUGIN_DIR . self::ASSETS_DIR . '/default/default_meta_fields.txt', FILE_IGNORE_NEW_LINES ); @@ -1090,6 +1092,8 @@ if (!class_exists('WC_Retailcrm_Base')) { $metaData[$metaValue->meta_key] = $metaValue->meta_key; } + $defaultMetaFields = apply_filters('retailcrm_change_default_meta_fields', $defaultMetaFields); + return array_diff($metaData, $defaultMetaFields); } diff --git a/src/readme.txt b/src/readme.txt index 3415656..b827746 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -5,7 +5,7 @@ Tags: Интеграция, Simla.com, simla Requires PHP: 7.0 Requires at least: 5.3 Tested up to: 6.5 -Stable tag: 4.8.1 +Stable tag: 4.8.2 License: GPLv1 or later License URI: http://www.gnu.org/licenses/gpl-1.0.html @@ -82,6 +82,10 @@ Asegúrate de tener una clave API específica para cada tienda. Las siguientes i == Changelog == += 4.8.2 = +* Fixed base file customization issue +* Added a hook to update the list of meta fields + = 4.8.1 = * Fix filtering of api query results diff --git a/src/retailcrm.php b/src/retailcrm.php index b84f54c..6d277d0 100644 --- a/src/retailcrm.php +++ b/src/retailcrm.php @@ -5,7 +5,7 @@ * Description: Integration plugin for WooCommerce & Simla.com * Author: RetailDriver LLC * Author URI: http://retailcrm.pro/ - * Version: 4.8.1 + * Version: 4.8.2 * Tested up to: 6.5 * Requires Plugins: woocommerce * WC requires at least: 5.4 diff --git a/src/uninstall.php b/src/uninstall.php index 43ec91b..839c519 100644 --- a/src/uninstall.php +++ b/src/uninstall.php @@ -16,7 +16,7 @@ * * @link https://wordpress.org/plugins/woo-retailcrm/ * - * @version 4.8.1 + * @version 4.8.2 * * @package RetailCRM */ diff --git a/tests/bin/install.sh b/tests/bin/install.sh index 15378f8..6615be9 100644 --- a/tests/bin/install.sh +++ b/tests/bin/install.sh @@ -39,6 +39,8 @@ download() { install_wp() { if [ -d $WP_CORE_DIR ]; then + mkdir -p $WP_CORE_DIR/wp-content/plugins/woo-retailcrm/assets/default + cp -n $PWD/src/assets/default/default_meta_fields.txt $WP_CORE_DIR/wp-content/plugins/woo-retailcrm/assets/default/ return; fi @@ -47,6 +49,8 @@ install_wp() { download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php + mkdir -p $WP_CORE_DIR/wp-content/plugins/woo-retailcrm/assets/default + cp -n $PWD/src/assets/default/default_meta_fields.txt $WP_CORE_DIR/wp-content/plugins/woo-retailcrm/assets/default/ } install_woocommerce() { @@ -105,4 +109,4 @@ install_db() { install_wp install_test_suite install_woocommerce -install_db \ No newline at end of file +install_db