Changeset 3195628
- Timestamp:
- 11/23/2024 08:29:39 PM (14 months ago)
- Location:
- wc-rearrange-order-items
- Files:
-
- 18 added
- 4 edited
- 1 copied
-
tags/1.0.2 (copied) (copied from wc-rearrange-order-items/trunk)
-
tags/1.0.2/.env (added)
-
tags/1.0.2/.vscode (added)
-
tags/1.0.2/.vscode/launch.json (added)
-
tags/1.0.2/.vscode/settings.json (added)
-
tags/1.0.2/Dockerfile (added)
-
tags/1.0.2/LICENSE (added)
-
tags/1.0.2/docker-compose.yaml (added)
-
tags/1.0.2/phpcs.xml (added)
-
tags/1.0.2/readme.txt (modified) (2 diffs)
-
tags/1.0.2/wc-orderitem-rearrange.php (modified) (6 diffs)
-
tags/1.0.2/wp-install.sh (added)
-
trunk/.env (added)
-
trunk/.vscode (added)
-
trunk/.vscode/launch.json (added)
-
trunk/.vscode/settings.json (added)
-
trunk/Dockerfile (added)
-
trunk/LICENSE (added)
-
trunk/docker-compose.yaml (added)
-
trunk/phpcs.xml (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wc-orderitem-rearrange.php (modified) (6 diffs)
-
trunk/wp-install.sh (added)
Legend:
- Unmodified
- Added
- Removed
-
wc-rearrange-order-items/tags/1.0.2/readme.txt
r3015753 r3195628 3 3 Tags: woocommerce, WC, rearrange, order items, orders, sorting, reorder 4 4 Requires at least: 3.1 5 Tested up to: 6. 45 Tested up to: 6.7 6 6 Stable tag: 1.0.0 7 License: GPLv2 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 7 License: MIT 9 8 10 9 Allow rearrange WooCommerce order items from the admin backend … … 30 29 == License == 31 30 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) 35 32 36 33 == Changelog == -
wc-rearrange-order-items/tags/1.0.2/wc-orderitem-rearrange.php
r3015753 r3195628 3 3 * Plugin Name: Rearrange Order Items for WooCommerce 4 4 * Description: Rearrange Woocommerce Order Item from admin backend 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: ole1986 <[email protected]> 7 7 * Author URI: https://github.com/ole1986/wc-orderitem-rearrange … … 10 10 * 11 11 * WC requires at least: 3.0.0 12 * WC tested up to: 8.412 * WC tested up to: 9.4 13 13 */ 14 14 … … 19 19 define('WCORDERITEMREARRANGE_PLUGIN_DIR', plugin_dir_path(__FILE__)); 20 20 define('WCORDERITEMREARRANGE_PLUGIN_URL', plugin_dir_url(__FILE__)); 21 22 21 23 22 class WcOrderItemRearrange … … 45 44 $direction = intval($_POST['direction']); 46 45 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 } 49 52 50 53 $orderItem = new \WC_Order_Item_Product($item_id); … … 57 60 $swap_id = $itemIds[$swapKey]; 58 61 59 if (!$swap_id) return; 62 if (!$swap_id) { 63 return; 64 } 60 65 61 66 $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); … … 86 91 } 87 92 88 89 93 $app = new WcOrderItemRearrange(); 90 94 95 add_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 91 102 add_action('init', [$app, 'init']); -
wc-rearrange-order-items/trunk/readme.txt
r3015753 r3195628 3 3 Tags: woocommerce, WC, rearrange, order items, orders, sorting, reorder 4 4 Requires at least: 3.1 5 Tested up to: 6. 45 Tested up to: 6.7 6 6 Stable tag: 1.0.0 7 License: GPLv2 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 7 License: MIT 9 8 10 9 Allow rearrange WooCommerce order items from the admin backend … … 30 29 == License == 31 30 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) 35 32 36 33 == Changelog == -
wc-rearrange-order-items/trunk/wc-orderitem-rearrange.php
r3015753 r3195628 3 3 * Plugin Name: Rearrange Order Items for WooCommerce 4 4 * Description: Rearrange Woocommerce Order Item from admin backend 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: ole1986 <[email protected]> 7 7 * Author URI: https://github.com/ole1986/wc-orderitem-rearrange … … 10 10 * 11 11 * WC requires at least: 3.0.0 12 * WC tested up to: 8.412 * WC tested up to: 9.4 13 13 */ 14 14 … … 19 19 define('WCORDERITEMREARRANGE_PLUGIN_DIR', plugin_dir_path(__FILE__)); 20 20 define('WCORDERITEMREARRANGE_PLUGIN_URL', plugin_dir_url(__FILE__)); 21 22 21 23 22 class WcOrderItemRearrange … … 45 44 $direction = intval($_POST['direction']); 46 45 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 } 49 52 50 53 $orderItem = new \WC_Order_Item_Product($item_id); … … 57 60 $swap_id = $itemIds[$swapKey]; 58 61 59 if (!$swap_id) return; 62 if (!$swap_id) { 63 return; 64 } 60 65 61 66 $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); … … 86 91 } 87 92 88 89 93 $app = new WcOrderItemRearrange(); 90 94 95 add_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 91 102 add_action('init', [$app, 'init']);
Note: See TracChangeset
for help on using the changeset viewer.