Plugin Directory

Changeset 3195628


Ignore:
Timestamp:
11/23/2024 08:29:39 PM (14 months ago)
Author:
ole1986
Message:

Update to version 1.0.2 from GitHub

Location:
wc-rearrange-order-items
Files:
18 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wc-rearrange-order-items/tags/1.0.2/readme.txt

    r3015753 r3195628  
    33Tags:  woocommerce, WC, rearrange, order items, orders, sorting, reorder
    44Requires at least: 3.1
    5 Tested up to: 6.4
     5Tested up to: 6.7
    66Stable tag: 1.0.0
    7 License: GPLv2
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     7License: MIT
    98
    109Allow rearrange WooCommerce order items from the admin backend
     
    3029== License ==
    3130
    32 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
    33 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    34 You should have received a copy of the GNU General Public License along with WP Nofollow More Links. If not, see <http://www.gnu.org/licenses/>.
     31[MIT LICENSED](https://github.com/ole1986/wc-invoice-pdf)
    3532
    3633== Changelog ==
  • wc-rearrange-order-items/tags/1.0.2/wc-orderitem-rearrange.php

    r3015753 r3195628  
    33 * Plugin Name: Rearrange Order Items for WooCommerce
    44 * Description: Rearrange Woocommerce Order Item from admin backend
    5  * Version: 1.0.1
     5 * Version: 1.0.2
    66 * Author: ole1986 <[email protected]>
    77 * Author URI: https://github.com/ole1986/wc-orderitem-rearrange
     
    1010 *
    1111 * WC requires at least: 3.0.0
    12  * WC tested up to: 8.4
     12 * WC tested up to: 9.4
    1313 */
    1414
     
    1919define('WCORDERITEMREARRANGE_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2020define('WCORDERITEMREARRANGE_PLUGIN_URL', plugin_dir_url(__FILE__));
    21 
    2221
    2322class WcOrderItemRearrange
     
    4544        $direction = intval($_POST['direction']);
    4645
    47         if (empty($item_id)) wp_die();
    48         if (is_null($direction)) wp_die();
     46        if (empty($item_id)) {
     47            wp_die();
     48        }
     49        if (is_null($direction)) {
     50            wp_die();
     51        }
    4952
    5053        $orderItem = new \WC_Order_Item_Product($item_id);
     
    5760        $swap_id = $itemIds[$swapKey];
    5861
    59         if (!$swap_id) return;
     62        if (!$swap_id) {
     63            return;
     64        }
    6065
    6166        $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d OR order_item_id = %d", $item_id, $swap_id), OBJECT);
     
    8691}
    8792
    88 
    8993$app = new WcOrderItemRearrange();
    9094
     95add_action('before_woocommerce_init', function () {
     96    // Support for WooCommerce High Performance Order Storage
     97    if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
     98        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
     99    }
     100});
     101
    91102add_action('init', [$app, 'init']);
  • wc-rearrange-order-items/trunk/readme.txt

    r3015753 r3195628  
    33Tags:  woocommerce, WC, rearrange, order items, orders, sorting, reorder
    44Requires at least: 3.1
    5 Tested up to: 6.4
     5Tested up to: 6.7
    66Stable tag: 1.0.0
    7 License: GPLv2
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     7License: MIT
    98
    109Allow rearrange WooCommerce order items from the admin backend
     
    3029== License ==
    3130
    32 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
    33 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    34 You should have received a copy of the GNU General Public License along with WP Nofollow More Links. If not, see <http://www.gnu.org/licenses/>.
     31[MIT LICENSED](https://github.com/ole1986/wc-invoice-pdf)
    3532
    3633== Changelog ==
  • wc-rearrange-order-items/trunk/wc-orderitem-rearrange.php

    r3015753 r3195628  
    33 * Plugin Name: Rearrange Order Items for WooCommerce
    44 * Description: Rearrange Woocommerce Order Item from admin backend
    5  * Version: 1.0.1
     5 * Version: 1.0.2
    66 * Author: ole1986 <[email protected]>
    77 * Author URI: https://github.com/ole1986/wc-orderitem-rearrange
     
    1010 *
    1111 * WC requires at least: 3.0.0
    12  * WC tested up to: 8.4
     12 * WC tested up to: 9.4
    1313 */
    1414
     
    1919define('WCORDERITEMREARRANGE_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2020define('WCORDERITEMREARRANGE_PLUGIN_URL', plugin_dir_url(__FILE__));
    21 
    2221
    2322class WcOrderItemRearrange
     
    4544        $direction = intval($_POST['direction']);
    4645
    47         if (empty($item_id)) wp_die();
    48         if (is_null($direction)) wp_die();
     46        if (empty($item_id)) {
     47            wp_die();
     48        }
     49        if (is_null($direction)) {
     50            wp_die();
     51        }
    4952
    5053        $orderItem = new \WC_Order_Item_Product($item_id);
     
    5760        $swap_id = $itemIds[$swapKey];
    5861
    59         if (!$swap_id) return;
     62        if (!$swap_id) {
     63            return;
     64        }
    6065
    6166        $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d OR order_item_id = %d", $item_id, $swap_id), OBJECT);
     
    8691}
    8792
    88 
    8993$app = new WcOrderItemRearrange();
    9094
     95add_action('before_woocommerce_init', function () {
     96    // Support for WooCommerce High Performance Order Storage
     97    if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
     98        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
     99    }
     100});
     101
    91102add_action('init', [$app, 'init']);
Note: See TracChangeset for help on using the changeset viewer.