Changeset 3310002
- Timestamp:
- 06/11/2025 06:45:33 PM (10 months ago)
- Location:
- hippoo/trunk
- Files:
-
- 4 edited
-
app/utils.php (modified) (1 diff)
-
app/web_api.php (modified) (1 diff)
-
hippoo.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hippoo/trunk/app/utils.php
r3249938 r3310002 1 1 <?php 2 function hippoo_get_temp_dir() {3 $wp_upload_dir = wp_upload_dir();4 $temp_dir = implode( DIRECTORY_SEPARATOR, [ $wp_upload_dir['basedir'], 'hippoo', 'tmp' ] ) . DIRECTORY_SEPARATOR;5 6 if (!file_exists($temp_dir)) {7 // phpcs:ignore8 mkdir($temp_dir, 0755, true);9 }2 function hippoo_get_temp_dir() { 3 $wp_upload_dir = wp_upload_dir(); 4 $temp_dir = implode( DIRECTORY_SEPARATOR, [ $wp_upload_dir['basedir'], 'hippoo', 'tmp' ] ) . DIRECTORY_SEPARATOR; 5 6 if (!file_exists($temp_dir)) { 7 // phpcs:ignore 8 mkdir($temp_dir, 0755, true); 9 } 10 10 11 return $temp_dir;12 }11 return $temp_dir; 12 } 13 13 14 function hippoo_get_product_by_slug($products, $name) { 15 foreach ($products as $product) { 16 if (strcasecmp($product['slug'], $name) === 0) { 17 return $product; 18 } 14 function hippoo_get_product_by_slug( $products, $name ) { 15 foreach ( $products as $product ) { 16 if ( strcasecmp( $product['slug'], $name ) === 0 ) { 17 return $product; 19 18 } 20 return null;21 19 } 20 return null; 21 } -
hippoo/trunk/app/web_api.php
r3288688 r3310002 492 492 return new WP_REST_Response($response_data, 200); 493 493 } 494 495 /* 496 * Add author information to WC order note API response 497 */ 498 add_filter( 'woocommerce_new_order_note_data', 'hippoo_wc_save_order_note_author', 10, 1 ); 499 500 function hippoo_wc_save_order_note_author( $data ) { 501 if ( is_user_logged_in() ) { 502 $user = get_user_by( 'id', get_current_user_id() ); 503 $data['user_id'] = $user->ID; 504 $data['comment_author'] = $user->display_name; 505 $data['comment_author_email'] = $user->user_email; 506 } 507 return $data; 508 } 509 510 add_filter( 'woocommerce_rest_prepare_order_note', 'hippoo_wc_prepare_order_note_author', 10, 3 ); 511 512 function hippoo_wc_prepare_order_note_author( $response, $note, $request ) { 513 $data = $response->get_data(); 514 515 if ( $note->user_id > 0 ) { 516 $user = get_user_by( 'id', $note->user_id ); 517 } else { 518 $user = get_user_by( 'email', $note->comment_author_email ); 519 } 520 521 if ( $user ) { 522 $data['author_id'] = $user->ID; 523 $data['author_email'] = $user->user_email; 524 } else { 525 $data['author_id'] = 0; 526 $data['author_email'] = ''; 527 } 528 529 $response->set_data($data); 530 return $response; 531 } -
hippoo/trunk/hippoo.php
r3288688 r3310002 2 2 /** 3 3 * Plugin Name: Hippoo Mobile app for WooCommerce 4 * Version: 1.5.1 34 * Version: 1.5.14 5 5 * Plugin URI: https://Hippoo.app/ 6 6 * Description: Best WooCommerce App Alternative – Manage orders and products on the go with real-time notifications, seamless order and product management, and powerful add-ons. Available for Android & iOS. 🚀. -
hippoo/trunk/readme.txt
r3288688 r3310002 5 5 Requires at least: 5.3 6 6 Tested up to: 6.7 7 Stable tag: 1.5.1 37 Stable tag: 1.5.14 8 8 License: GPL3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 71 71 72 72 == Changelog == 73 * 1.5.14 - Minor Improvements 73 74 * 1.5.13 - Fix scripts.js url 74 75 * 1.5.12 - Minor Improvements
Note: See TracChangeset
for help on using the changeset viewer.