Changeset 3022575
- Timestamp:
- 01/16/2024 06:11:45 PM (2 years ago)
- Location:
- api2cart-webhook-helper/trunk
- Files:
-
- 3 edited
-
a2c-webhook-helper.php (modified) (1 diff)
-
app/WH_Helper.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
api2cart-webhook-helper/trunk/a2c-webhook-helper.php
r2964488 r3022575 4 4 Description: The plugin adds extra webhook topics for WooCommerce. 5 5 Author: API2Cart 6 Version: 1. 6.66 Version: 1.7 7 7 Author URI: https://api2cart.com/ 8 8 License: GPL2 -
api2cart-webhook-helper/trunk/app/WH_Helper.php
r2964488 r3022575 9 9 { 10 10 11 const VERSION = '1. 6.6';11 const VERSION = '1.7'; 12 12 const LANG_DOMAIN = 'a2c_wh'; 13 13 … … 65 65 add_action( 'woocommerce_update_product_variation', array( $this, 'updateChild' ), 29, 2); 66 66 add_action( 'woocommerce_before_delete_product_variation', array( $this, 'deleteChild' ), 29, 1); 67 68 add_action( 'create_product_cat', array( $this, 'afterCategoryInsert' ), 29, 3); 69 add_action( 'edited_product_cat', array( $this, 'afterCategoryUpdate' ), 29, 4); 70 add_action( 'delete_term_taxonomy', array( $this, 'afterCategoryDelete' ), 29, 4); 67 71 68 72 $this->_blogId = get_current_blog_id(); … … 236 240 237 241 do_action('a2c_wh_variant_deleted_action', ['store_id' => $this->_blogId, 'parent_id' => $parent->post_parent, 'id' => $id]); 242 } 243 244 /** 245 * @param $term_id 246 */ 247 function afterCategoryInsert($term_id) { 248 do_action('a2c_wh_category_created_action', ['store_id' => $this->_blogId, 'id' => $term_id]); 249 } 250 251 /** 252 * @param $term_id 253 */ 254 function afterCategoryUpdate($term_id) { 255 do_action('a2c_wh_category_updated_action', ['store_id' => $this->_blogId, 'id' => $term_id]); 256 } 257 258 /** 259 * @param $term_id 260 */ 261 function afterCategoryDelete($term_id) { 262 do_action('a2c_wh_category_deleted_action', ['store_id' => $this->_blogId, 'id' => $term_id]); 238 263 } 239 264 … … 288 313 $resources[] = 'order_shipment'; 289 314 $resources[] = 'variant'; 315 $resources[] = 'category'; 290 316 291 317 return $resources; … … 311 337 'variant.updated' => __( 'Variant Updated', 'a2c_wh' ), 312 338 'variant.deleted' => __( 'Variant Deleted', 'a2c_wh' ), 339 'category.created' => __( 'Category Created', 'a2c_wh' ), 340 'category.updated' => __( 'Category Updated', 'a2c_wh' ), 341 'category.deleted' => __( 'Category Deleted', 'a2c_wh' ), 313 342 ) 314 343 ); … … 604 633 'a2c_wh_variant_deleted_action', 605 634 ); 635 $topics['category.created'] = array( 636 'a2c_wh_category_created_action', 637 ); 638 $topics['category.updated'] = array( 639 'a2c_wh_category_updated_action', 640 ); 641 $topics['category.deleted'] = array( 642 'a2c_wh_category_deleted_action', 643 ); 606 644 607 645 return $topics; … … 617 655 public function buildWebhookPayload($payload, $resource, $resource_id) 618 656 { 619 if ( in_array($resource, ['basket', 'order_shipment', 'variant' ] )) {657 if ( in_array($resource, ['basket', 'order_shipment', 'variant', 'category'] )) { 620 658 $payload = $resource_id; 621 659 } -
api2cart-webhook-helper/trunk/readme.txt
r3006762 r3022575 5 5 Requires at least: 4.1 6 6 Tested up to: 6.5 7 Stable tag: 1. 6.67 Stable tag: 1.7 8 8 License: GPL2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 48 48 49 49 == Changelog == 50 = 1.7 = 51 * Added webhooks 'Category Created, Category Updated, Category Deleted' 52 50 53 = 1.6.6 = 51 54 * Fix bugs
Note: See TracChangeset
for help on using the changeset viewer.