Changeset 2629209
- Timestamp:
- 11/13/2021 07:28:31 PM (4 years ago)
- Location:
- wooms/trunk
- Files:
-
- 8 added
- 4 edited
-
css (added)
-
css/admin.css (added)
-
docs (added)
-
docs/_config.yml (added)
-
docs/getting-started.md (added)
-
docs/index.md (added)
-
docs/qa.md (added)
-
docs/xt.md (added)
-
functions.php (modified) (1 diff)
-
inc/ProductsWalker.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
wooms.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wooms/trunk/functions.php
r2418704 r2629209 140 140 } 141 141 } 142 143 /** 144 * Checking if wooms meta is unique and deleting if it is duplicated in save_post action 145 * 146 * @param int $post_ID Post ID. 147 * @param WP_Post $post Post object. 148 * @param bool $update Whether this is an existing post being updated. 149 * 150 * @return void 151 * 152 * @link https://github.com/wpcraft-ru/wooms/issues/409 153 */ 154 function wooms_id_check_if_unique($post_ID, $post = '', $update = '') { 155 156 if (!$post_ID || !is_numeric($post_ID)) { 157 return; 158 } 159 160 $uuid = get_post_meta($post_ID, 'wooms_id', true); 161 162 if (!$uuid) { 163 return; 164 } 165 166 $basic_args = array( 167 'post_type' => array('product', 'product_variation'), 168 'numberposts' => -1, 169 'post_status' => 'any', 170 'orderby' => 'ID', 171 'order' => 'ASC', 172 'update_post_term_cache' => false, 173 'update_post_meta_cache' => false, 174 'cache_results' => false, 175 ); 176 177 $products_args = array( 178 'meta_key' => 'wooms_id', 179 'meta_value' => $uuid 180 ); 181 182 $args = array_merge($basic_args, $products_args); 183 184 $products = get_posts($args); 185 186 $ids = []; 187 188 if (count($products) > 1) { 189 190 foreach ($products as $key => $product) { 191 192 if ($key > 0) { 193 194 $ids[] = $product->ID; 195 } 196 } 197 } 198 199 if (empty($ids)) { 200 return; 201 } 202 203 /* Selecting all child variations */ 204 $variations_args = array( 205 'post_parent__in' => $ids, 206 ); 207 208 $args = array_merge($basic_args, $variations_args); 209 210 $variations = get_posts($args); 211 212 foreach ($variations as $variation) { 213 214 $ids[] = $variation->ID; 215 } 216 217 foreach ($ids as $id) { 218 219 $meta_values = get_post_meta( $id ); 220 221 foreach ($meta_values as $key => $values) { 222 if (preg_match('/^wooms_/', $key)) { 223 delete_post_meta($id, $key); 224 } 225 } 226 } 227 228 do_action( 229 'wooms_logger', 230 $type = 'WooMS-Request', 231 $title = sprintf('Дубли meta-полей wooms для товаров и вариаций (%s) удалены', implode(', ', $ids)) 232 ); 233 } -
wooms/trunk/inc/ProductsWalker.php
r2429596 r2629209 71 71 self::add_setting_wooms_batch_size(); 72 72 self::add_setting_short_description(); 73 74 do_action('wooms_add_settings'); 73 75 } 74 76 -
wooms/trunk/readme.txt
r2517682 r2629209 4 4 Tags: moysklad, woocommerce, sync, integration 5 5 Requires at least: 4.0 6 Tested up to: 5. 36 Tested up to: 5.8 7 7 Stable tag: 4.3 8 8 Requires PHP: 5.6 … … 72 72 = Какие минимальные требования? = 73 73 74 WordPress 4.574 WordPress 5.0 75 75 WooCommerce 3.0 - мб будет работать на Woo 2.х но не факт. 76 76 PHP 5.6 … … 84 84 85 85 == Changelog == 86 87 = 8.4 = 88 - Проверка совместимости с WooCommerce 5.8 89 - Исправление проблем с деплоем 90 91 = 8.3 = 92 - Проверка совместимости с WooCommerce 5.6 93 - Исправление ошибок 94 86 95 87 96 = 8.2 = … … 95 104 - Краткое описание товара вместо полного как опция https://github.com/wpcraft-ru/wooms/issues/347 96 105 - XT: При создании нового контрагента - нет email https://github.com/wpcraft-ru/wooms/issues/346 106 * Тест плагинов с новыми версиями WordPress и WooCommerce https://github.com/wpcraft-ru/wooms/issues/396 107 * [XT] Публикация решения для отображения остатков со множества складов через ACF https://github.com/wpcraft-ru/wooms/issues/327 108 * [XT] Публикация решения для передачи склада в заказе через методы доставки https://github.com/wpcraft-ru/wooms/issues/327 97 109 98 110 = 8.0 = -
wooms/trunk/wooms.php
r2517682 r2629209 12 12 * License: GPLv2 or later 13 13 * License URI: http://www.gnu.org/licenses/gpl-2.0.html 14 * WC requires at least: 4.0 15 * WC tested up to: 5.2.0 14 * 16 15 * PHP requires at least: 5.6 16 * WC requires at least: 5.0 17 * WC tested up to: 5.9 17 18 * WP requires at least: 5.0 18 * Tested up to: 5.7 19 * WooMS XT Latest: 8.2 20 * Version: 8.2 19 * Tested up to: 5.8.1 20 * WooMS XT Latest: 8.5 21 * 22 * Version: 8.5 21 23 */ 22 24 … … 96 98 require_once __DIR__ . '/inc/MenuSettings.php'; 97 99 require_once __DIR__ . '/inc/MenuTools.php'; 100 101 require_once __DIR__ . '/inc/MetaColumn.php'; 98 102 99 103 … … 130 134 131 135 add_action('init', [__CLASS__, 'delete_old_schedules']); 136 add_action('save_post', 'wooms_id_check_if_unique', 10, 3); 137 add_action('admin_enqueue_scripts', array(__CLASS__, 'admin_styles')); 138 132 139 } 133 140 … … 297 304 } 298 305 306 /** 307 * Styles for Dashboard 308 * 309 * @return void 310 */ 311 public static function admin_styles() { 312 313 $admin_style = plugin_dir_url( __FILE__ ) . 'css/admin.css'; 314 315 wp_enqueue_style( 'wooms_styles', $admin_style, array() ); 316 317 } 299 318 } 300 319
Note: See TracChangeset
for help on using the changeset viewer.