Plugin Directory

Changeset 3310002


Ignore:
Timestamp:
06/11/2025 06:45:33 PM (10 months ago)
Author:
hippooo
Message:

1.5.14

Location:
hippoo/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • hippoo/trunk/app/utils.php

    r3249938 r3310002  
    11<?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:ignore
    8             mkdir($temp_dir, 0755, true);
    9         }
     2function 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    }
    1010
    11         return $temp_dir;
    12     }
     11    return $temp_dir;
     12}
    1313
    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             }
     14function hippoo_get_product_by_slug( $products, $name ) {
     15    foreach ( $products as $product ) {
     16        if ( strcasecmp( $product['slug'], $name ) === 0 ) {
     17            return $product;
    1918        }
    20         return null;
    2119    }
     20    return null;
     21}
  • hippoo/trunk/app/web_api.php

    r3288688 r3310002  
    492492    return new WP_REST_Response($response_data, 200);
    493493}
     494
     495/*
     496* Add author information to WC order note API response
     497*/
     498add_filter( 'woocommerce_new_order_note_data', 'hippoo_wc_save_order_note_author', 10, 1 );
     499
     500function 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
     510add_filter( 'woocommerce_rest_prepare_order_note', 'hippoo_wc_prepare_order_note_author', 10, 3 );
     511
     512function 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  
    22/**
    33 * Plugin Name: Hippoo Mobile app for WooCommerce
    4  * Version: 1.5.13
     4 * Version: 1.5.14
    55 * Plugin URI: https://Hippoo.app/
    66 * 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  
    55Requires at least: 5.3
    66Tested up to: 6.7
    7 Stable tag: 1.5.13
     7Stable tag: 1.5.14
    88License: GPL3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7171
    7272== Changelog ==
     73* 1.5.14 - Minor Improvements
    7374* 1.5.13 - Fix scripts.js url
    7475* 1.5.12 - Minor Improvements
Note: See TracChangeset for help on using the changeset viewer.