Changeset 2932985
- Timestamp:
- 07/02/2023 08:09:41 AM (3 years ago)
- Location:
- admin-previous-and-next-order-edit-links-for-woocommerce
- Files:
-
- 66 added
- 12 edited
-
tags/1.0.0 (added)
-
tags/1.0.0/LICENSE.txt (added)
-
tags/1.0.0/README.txt (added)
-
tags/1.0.0/admin (added)
-
tags/1.0.0/admin/class-previous-next-edit-order-links-for-woocommerce-admin.php (added)
-
tags/1.0.0/admin/css (added)
-
tags/1.0.0/admin/css/previous-next-edit-order-links-for-woocommerce-admin.css (added)
-
tags/1.0.0/admin/index.php (added)
-
tags/1.0.0/admin/js (added)
-
tags/1.0.0/admin/js/previous-next-edit-order-links-for-woocommerce-admin.js (added)
-
tags/1.0.0/admin/partials (added)
-
tags/1.0.0/admin/partials/previous-next-edit-order-links-for-woocommerce-admin-display.php (added)
-
tags/1.0.0/includes (added)
-
tags/1.0.0/includes/class-previous-next-edit-order-links-for-woocommerce-activator.php (added)
-
tags/1.0.0/includes/class-previous-next-edit-order-links-for-woocommerce-deactivator.php (added)
-
tags/1.0.0/includes/class-previous-next-edit-order-links-for-woocommerce-i18n.php (added)
-
tags/1.0.0/includes/class-previous-next-edit-order-links-for-woocommerce-loader.php (added)
-
tags/1.0.0/includes/class-previous-next-edit-order-links-for-woocommerce.php (added)
-
tags/1.0.0/includes/index.php (added)
-
tags/1.0.0/index.php (added)
-
tags/1.0.0/languages (added)
-
tags/1.0.0/languages/previous-next-edit-order-links-for-woocommerce.pot (added)
-
tags/1.0.0/previous-next-edit-order-links-for-woocommerce.php (added)
-
tags/1.0.0/public (added)
-
tags/1.0.0/public/class-previous-next-edit-order-links-for-woocommerce-public.php (added)
-
tags/1.0.0/public/css (added)
-
tags/1.0.0/public/css/previous-next-edit-order-links-for-woocommerce-public.css (added)
-
tags/1.0.0/public/index.php (added)
-
tags/1.0.0/public/js (added)
-
tags/1.0.0/public/js/previous-next-edit-order-links-for-woocommerce-public.js (added)
-
tags/1.0.0/public/partials (added)
-
tags/1.0.0/public/partials/previous-next-edit-order-links-for-woocommerce-public-display.php (added)
-
tags/1.0.0/uninstall.php (added)
-
tags/1.0.1 (added)
-
tags/1.0.1/LICENSE.txt (added)
-
tags/1.0.1/README.txt (added)
-
tags/1.0.1/admin (added)
-
tags/1.0.1/admin/class-previous-next-edit-order-links-for-woocommerce-admin.php (added)
-
tags/1.0.1/admin/css (added)
-
tags/1.0.1/admin/css/previous-next-edit-order-links-for-woocommerce-admin.css (added)
-
tags/1.0.1/admin/index.php (added)
-
tags/1.0.1/admin/js (added)
-
tags/1.0.1/admin/js/previous-next-edit-order-links-for-woocommerce-admin.js (added)
-
tags/1.0.1/admin/partials (added)
-
tags/1.0.1/admin/partials/previous-next-edit-order-links-for-woocommerce-admin-display.php (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-previous-next-edit-order-links-for-woocommerce-activator.php (added)
-
tags/1.0.1/includes/class-previous-next-edit-order-links-for-woocommerce-deactivator.php (added)
-
tags/1.0.1/includes/class-previous-next-edit-order-links-for-woocommerce-i18n.php (added)
-
tags/1.0.1/includes/class-previous-next-edit-order-links-for-woocommerce-loader.php (added)
-
tags/1.0.1/includes/class-previous-next-edit-order-links-for-woocommerce.php (added)
-
tags/1.0.1/includes/index.php (added)
-
tags/1.0.1/index.php (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/previous-next-edit-order-links-for-woocommerce.pot (added)
-
tags/1.0.1/previous-next-edit-order-links-for-woocommerce.php (added)
-
tags/1.0.1/public (added)
-
tags/1.0.1/public/class-previous-next-edit-order-links-for-woocommerce-public.php (added)
-
tags/1.0.1/public/css (added)
-
tags/1.0.1/public/css/previous-next-edit-order-links-for-woocommerce-public.css (added)
-
tags/1.0.1/public/index.php (added)
-
tags/1.0.1/public/js (added)
-
tags/1.0.1/public/js/previous-next-edit-order-links-for-woocommerce-public.js (added)
-
tags/1.0.1/public/partials (added)
-
tags/1.0.1/public/partials/previous-next-edit-order-links-for-woocommerce-public-display.php (added)
-
tags/1.0.1/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-previous-next-edit-order-links-for-woocommerce-admin.php (modified) (7 diffs)
-
trunk/admin/partials/previous-next-edit-order-links-for-woocommerce-admin-display.php (modified) (1 diff)
-
trunk/includes/class-previous-next-edit-order-links-for-woocommerce-activator.php (modified) (3 diffs)
-
trunk/includes/class-previous-next-edit-order-links-for-woocommerce-deactivator.php (modified) (3 diffs)
-
trunk/includes/class-previous-next-edit-order-links-for-woocommerce-i18n.php (modified) (3 diffs)
-
trunk/includes/class-previous-next-edit-order-links-for-woocommerce-loader.php (modified) (8 diffs)
-
trunk/includes/class-previous-next-edit-order-links-for-woocommerce.php (modified) (15 diffs)
-
trunk/previous-next-edit-order-links-for-woocommerce.php (modified) (4 diffs)
-
trunk/public/class-previous-next-edit-order-links-for-woocommerce-public.php (modified) (6 diffs)
-
trunk/public/partials/previous-next-edit-order-links-for-woocommerce-public-display.php (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/README.txt
r2882730 r2932985 5 5 Tested up to: 6.2 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 Donate link: https://www.buymeacoffee.com/BELOCODES 9 9 License: GPLv2 or later … … 72 72 Initial release 73 73 74 = 1.0.1 = 75 Bug Fixes plus minor upgrades 74 76 -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/admin/class-previous-next-edit-order-links-for-woocommerce-admin.php
r2878036 r2932985 5 5 * 6 6 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 7 * @since 1.0. 07 * @since 1.0.1 8 8 * 9 9 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 26 26 * The ID of this plugin. 27 27 * 28 * @since 1.0. 028 * @since 1.0.1 29 29 * @access private 30 30 * @var string $plugin_name The ID of this plugin. … … 35 35 * The version of this plugin. 36 36 * 37 * @since 1.0. 037 * @since 1.0.1 38 38 * @access private 39 39 * @var string $version The current version of this plugin. … … 44 44 * Initialize the class and set its properties. 45 45 * 46 * @since 1.0. 046 * @since 1.0.1 47 47 * @param string $plugin_name The name of this plugin. 48 48 * @param string $version The version of this plugin. … … 58 58 * Register the stylesheets for the admin area. 59 59 * 60 * @since 1.0. 060 * @since 1.0.1 61 61 */ 62 62 public function enqueue_styles() { … … 81 81 * Register the JavaScript for the admin area. 82 82 * 83 * @since 1.0. 083 * @since 1.0.1 84 84 */ 85 85 public function enqueue_scripts() { … … 107 107 $screen_id = isset( $screen, $screen->id ) ? $screen->id : ''; 108 108 if ( $screen_id == 'shop_order' ) { 109 //Import the orders' data--------- 110 $query = new WC_Order_Query( array( 111 'limit' => -1, 112 'orderby' => 'date', 113 'order' => 'DESC', 114 'return' => 'ids', 115 ) ); 116 $orders_belo = $query->get_orders(); 117 $cur = 0; 118 $prev = 0; 119 $next = 0; 120 for($i=0;$i<=count($orders_belo);$i++){ 121 if($post){ 122 if($orders_belo[$i] == $post->ID){ 123 $cur = $i; 124 $prev = $cur - 1; 125 $next = $cur + 1; 126 break; 127 } 109 110 global $post, $wpdb, $theorder; 111 112 if ( ! is_object( $theorder ) ) { 113 $theorder = wc_get_order( $post->ID ); 128 114 } 129 130 }131 115 132 //Filling the Output array--------- 133 if($prev >= 0 ){ 134 if(!empty($orders_belo[$prev])){ 135 $final_prev_next_output["prev"] = admin_url( 'post.php?post='.$orders_belo[$prev].'&action=edit' ); 136 } 137 } 138 if($next > 0 ){ 139 if(!empty($orders_belo[$next])){ 140 $final_prev_next_output["next"] = admin_url( 'post.php?post='.$orders_belo[$next].'&action=edit' ); 141 } 142 } 143 144 //Enqueuing the Output JS scripts--------- 145 146 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/previous-next-edit-order-links-for-woocommerce-admin.js', array( 'jquery' ), $this->version, false ); 147 wp_localize_script($this->plugin_name, 'prev_next_script_vars', array( 148 "prev" => $final_prev_next_output["prev"], 149 "prev_text" => __('Previous Order','belo_prev_next_domain'), 150 "next" => $final_prev_next_output["next"], 151 "next_text" => __('Next Order','belo_prev_next_domain') 152 ) 153 ); 154 } 116 $order_type_object = get_post_type_object( $post->post_type ); 117 118 $order_navigation = $wpdb->get_row( $wpdb->prepare( " 119 SELECT 120 (SELECT ID FROM {$wpdb->prefix}posts 121 WHERE ID < %d 122 AND post_type = '%s' 123 AND post_status <> 'trash' 124 ORDER BY ID DESC LIMIT 1 ) 125 AS prev_order_id, 126 (SELECT ID FROM {$wpdb->prefix}posts 127 WHERE ID > %d 128 AND post_type = '%s' 129 AND post_status <> 'trash' 130 ORDER BY ID ASC LIMIT 1 ) 131 AS next_order_id 132 ", $post->ID, $post->post_type, $post->ID, $post->post_type ), ARRAY_A ); 133 134 //Filling the Output array--------- 135 if ( array_filter( $order_navigation ) ) : 136 137 endif; 138 139 140 if(!empty($order_navigation[ 'prev_order_id' ])){ 141 $final_prev_next_output["prev"] = admin_url( 'post.php?post='.$order_navigation[ 'prev_order_id' ].'&action=edit' ); 142 } 143 if(!empty($order_navigation[ 'next_order_id' ])){ 144 $final_prev_next_output["next"] = admin_url( 'post.php?post='.$order_navigation[ 'next_order_id' ].'&action=edit' ); 145 } 146 147 //Enqueuing the Output JS scripts--------- 148 149 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 150 'js/previous-next-edit-order-links-for-woocommerce-admin.js', array( 'jquery' ), $this->version, false ); 151 wp_localize_script($this->plugin_name, 'prev_next_script_vars', array( 152 "prev" => $final_prev_next_output["prev"], 153 "prev_text" => __('Previous Order','belo_prev_next_domain'), 154 "next" => $final_prev_next_output["next"], 155 "next_text" => __('Next Order','belo_prev_next_domain') 156 ) 157 ); 158 } 155 159 } 156 160 -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/admin/partials/previous-next-edit-order-links-for-woocommerce-admin-display.php
r2878036 r2932985 7 7 * 8 8 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 9 * @since 1.0. 09 * @since 1.0.1 10 10 * 11 11 * @package Previous_Next_Edit_Order_Links_For_Woocommerce -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/includes/class-previous-next-edit-order-links-for-woocommerce-activator.php
r2878036 r2932985 5 5 * 6 6 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 7 * @since 1.0. 07 * @since 1.0.1 8 8 * 9 9 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 16 16 * This class defines all code necessary to run during the plugin's activation. 17 17 * 18 * @since 1.0. 018 * @since 1.0.1 19 19 * @package Previous_Next_Edit_Order_Links_For_Woocommerce 20 20 * @subpackage Previous_Next_Edit_Order_Links_For_Woocommerce/includes … … 28 28 * Long Description. 29 29 * 30 * @since 1.0. 030 * @since 1.0.1 31 31 */ 32 32 public static function activate() { -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/includes/class-previous-next-edit-order-links-for-woocommerce-deactivator.php
r2878036 r2932985 5 5 * 6 6 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 7 * @since 1.0. 07 * @since 1.0.1 8 8 * 9 9 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 16 16 * This class defines all code necessary to run during the plugin's deactivation. 17 17 * 18 * @since 1.0. 018 * @since 1.0.1 19 19 * @package Previous_Next_Edit_Order_Links_For_Woocommerce 20 20 * @subpackage Previous_Next_Edit_Order_Links_For_Woocommerce/includes … … 28 28 * Long Description. 29 29 * 30 * @since 1.0. 030 * @since 1.0.1 31 31 */ 32 32 public static function deactivate() { -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/includes/class-previous-next-edit-order-links-for-woocommerce-i18n.php
r2878036 r2932985 8 8 * 9 9 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 10 * @since 1.0. 010 * @since 1.0.1 11 11 * 12 12 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 20 20 * so that it is ready for translation. 21 21 * 22 * @since 1.0. 022 * @since 1.0.1 23 23 * @package Previous_Next_Edit_Order_Links_For_Woocommerce 24 24 * @subpackage Previous_Next_Edit_Order_Links_For_Woocommerce/includes … … 31 31 * Load the plugin text domain for translation. 32 32 * 33 * @since 1.0. 033 * @since 1.0.1 34 34 */ 35 35 public function load_plugin_textdomain() { -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/includes/class-previous-next-edit-order-links-for-woocommerce-loader.php
r2878036 r2932985 5 5 * 6 6 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 7 * @since 1.0. 07 * @since 1.0.1 8 8 * 9 9 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 27 27 * The array of actions registered with WordPress. 28 28 * 29 * @since 1.0. 029 * @since 1.0.1 30 30 * @access protected 31 31 * @var array $actions The actions registered with WordPress to fire when the plugin loads. … … 36 36 * The array of filters registered with WordPress. 37 37 * 38 * @since 1.0. 038 * @since 1.0.1 39 39 * @access protected 40 40 * @var array $filters The filters registered with WordPress to fire when the plugin loads. … … 45 45 * Initialize the collections used to maintain the actions and filters. 46 46 * 47 * @since 1.0. 047 * @since 1.0.1 48 48 */ 49 49 public function __construct() { … … 57 57 * Add a new action to the collection to be registered with WordPress. 58 58 * 59 * @since 1.0. 059 * @since 1.0.1 60 60 * @param string $hook The name of the WordPress action that is being registered. 61 61 * @param object $component A reference to the instance of the object on which the action is defined. … … 71 71 * Add a new filter to the collection to be registered with WordPress. 72 72 * 73 * @since 1.0. 073 * @since 1.0.1 74 74 * @param string $hook The name of the WordPress filter that is being registered. 75 75 * @param object $component A reference to the instance of the object on which the filter is defined. … … 86 86 * collection. 87 87 * 88 * @since 1.0. 088 * @since 1.0.1 89 89 * @access private 90 90 * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). … … 113 113 * Register the filters and actions with WordPress. 114 114 * 115 * @since 1.0. 0115 * @since 1.0.1 116 116 */ 117 117 public function run() { -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/includes/class-previous-next-edit-order-links-for-woocommerce.php
r2878036 r2932985 8 8 * 9 9 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 10 * @since 1.0. 010 * @since 1.0.1 11 11 * 12 12 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 23 23 * version of the plugin. 24 24 * 25 * @since 1.0. 025 * @since 1.0.1 26 26 * @package Previous_Next_Edit_Order_Links_For_Woocommerce 27 27 * @subpackage Previous_Next_Edit_Order_Links_For_Woocommerce/includes … … 34 34 * the plugin. 35 35 * 36 * @since 1.0. 036 * @since 1.0.1 37 37 * @access protected 38 38 * @var Previous_Next_Edit_Order_Links_For_Woocommerce_Loader $loader Maintains and registers all hooks for the plugin. … … 43 43 * The unique identifier of this plugin. 44 44 * 45 * @since 1.0. 045 * @since 1.0.1 46 46 * @access protected 47 47 * @var string $plugin_name The string used to uniquely identify this plugin. … … 52 52 * The current version of the plugin. 53 53 * 54 * @since 1.0. 054 * @since 1.0.1 55 55 * @access protected 56 56 * @var string $version The current version of the plugin. … … 65 65 * the public-facing side of the site. 66 66 * 67 * @since 1.0. 067 * @since 1.0.1 68 68 */ 69 69 public function __construct() { … … 71 71 $this->version = PREVIOUS_NEXT_EDIT_ORDER_LINKS_FOR_WOOCOMMERCE_VERSION; 72 72 } else { 73 $this->version = '1.0. 0';73 $this->version = '1.0.1'; 74 74 } 75 75 $this->plugin_name = 'previous-next-edit-order-links-for-woocommerce'; … … 95 95 * with WordPress. 96 96 * 97 * @since 1.0. 097 * @since 1.0.1 98 98 * @access private 99 99 */ … … 133 133 * with WordPress. 134 134 * 135 * @since 1.0. 0135 * @since 1.0.1 136 136 * @access private 137 137 */ … … 148 148 * of the plugin. 149 149 * 150 * @since 1.0. 0150 * @since 1.0.1 151 151 * @access private 152 152 */ … … 164 164 * of the plugin. 165 165 * 166 * @since 1.0. 0166 * @since 1.0.1 167 167 * @access private 168 168 */ … … 179 179 * Run the loader to execute all of the hooks with WordPress. 180 180 * 181 * @since 1.0. 0181 * @since 1.0.1 182 182 */ 183 183 public function run() { … … 189 189 * WordPress and to define internationalization functionality. 190 190 * 191 * @since 1.0. 0191 * @since 1.0.1 192 192 * @return string The name of the plugin. 193 193 */ … … 199 199 * The reference to the class that orchestrates the hooks with the plugin. 200 200 * 201 * @since 1.0. 0201 * @since 1.0.1 202 202 * @return Previous_Next_Edit_Order_Links_For_Woocommerce_Loader Orchestrates the hooks of the plugin. 203 203 */ … … 209 209 * Retrieve the version number of the plugin. 210 210 * 211 * @since 1.0. 0211 * @since 1.0.1 212 212 * @return string The version number of the plugin. 213 213 */ -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/previous-next-edit-order-links-for-woocommerce.php
r2878036 r2932985 10 10 * 11 11 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 12 * @since 1.0. 012 * @since 1.0.1 13 13 * @package Previous_Next_Edit_Order_Links_For_Woocommerce 14 14 * … … 17 17 * Plugin URI: https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 18 18 * Description: This plugin enables you to quickly access and edit the next and previous orders. It saves times while processing orders in a sequence which boosts productivity. 19 * Version: 1.0. 020 * Author: Belo 19 * Version: 1.0.1 20 * Author: Belo 21 21 * Author URI: https://profiles.wordpress.org/cylas/ 22 22 * License: GPL-2.0+ … … 49 49 /** 50 50 * Currently plugin version. 51 * Start at version 1.0. 0and use SemVer - https://semver.org51 * Start at version 1.0.1 and use SemVer - https://semver.org 52 52 * Rename this for your plugin and update it as you release new versions. 53 53 */ 54 define( 'PREVIOUS_NEXT_EDIT_ORDER_LINKS_FOR_WOOCOMMERCE_VERSION', '1.0. 0' );54 define( 'PREVIOUS_NEXT_EDIT_ORDER_LINKS_FOR_WOOCOMMERCE_VERSION', '1.0.1' ); 55 55 56 56 /** … … 88 88 * not affect the page life cycle. 89 89 * 90 * @since 1.0. 090 * @since 1.0.1 91 91 */ 92 92 function run_previous_next_edit_order_links_for_woocommerce() { -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/public/class-previous-next-edit-order-links-for-woocommerce-public.php
r2878036 r2932985 5 5 * 6 6 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 7 * @since 1.0. 07 * @since 1.0.1 8 8 * 9 9 * @package Previous_Next_Edit_Order_Links_For_Woocommerce … … 26 26 * The ID of this plugin. 27 27 * 28 * @since 1.0. 028 * @since 1.0.1 29 29 * @access private 30 30 * @var string $plugin_name The ID of this plugin. … … 35 35 * The version of this plugin. 36 36 * 37 * @since 1.0. 037 * @since 1.0.1 38 38 * @access private 39 39 * @var string $version The current version of this plugin. … … 44 44 * Initialize the class and set its properties. 45 45 * 46 * @since 1.0. 046 * @since 1.0.1 47 47 * @param string $plugin_name The name of the plugin. 48 48 * @param string $version The version of this plugin. … … 58 58 * Register the stylesheets for the public-facing side of the site. 59 59 * 60 * @since 1.0. 060 * @since 1.0.1 61 61 */ 62 62 public function enqueue_styles() { … … 81 81 * Register the JavaScript for the public-facing side of the site. 82 82 * 83 * @since 1.0. 083 * @since 1.0.1 84 84 */ 85 85 public function enqueue_scripts() { -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/public/partials/previous-next-edit-order-links-for-woocommerce-public-display.php
r2878036 r2932985 7 7 * 8 8 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 9 * @since 1.0. 09 * @since 1.0.1 10 10 * 11 11 * @package Previous_Next_Edit_Order_Links_For_Woocommerce -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/uninstall.php
r2878036 r2932985 20 20 * 21 21 * @link https://github.com/CylasKiganda/previous-next-edit-order-links-for-woocommerce 22 * @since 1.0. 022 * @since 1.0.1 23 23 * 24 24 * @package Previous_Next_Edit_Order_Links_For_Woocommerce
Note: See TracChangeset
for help on using the changeset viewer.