Changeset 2986962
- Timestamp:
- 10/31/2023 06:31:43 PM (2 years ago)
- Location:
- admin-previous-and-next-order-edit-links-for-woocommerce/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (2 diffs)
-
admin/class-previous-next-edit-order-links-for-woocommerce-admin.php (modified) (5 diffs)
-
admin/css/previous-next-edit-order-links-for-woocommerce-admin.css (modified) (1 diff)
-
previous-next-edit-order-links-for-woocommerce.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/README.txt
r2944263 r2986962 3 3 Contributors: cylas 4 4 Requires at least: 5.2 or higher 5 Tested up to: 6. 36 Requires PHP: 7.0.07 Stable tag: 1.0. 15 Tested up to: 6.4 6 Requires PHP: 5.6 7 Stable tag: 1.0.2 8 8 Donate link: https://www.buymeacoffee.com/BELOCODES 9 9 License: GPLv2 or later … … 75 75 Bug Fixes plus minor upgrades 76 76 77 = 1.0.2 = 78 Woocommerce HPOS integration, syncing wordpress' default button style -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/admin/class-previous-next-edit-order-links-for-woocommerce-admin.php
r2932985 r2986962 58 58 * Register the stylesheets for the admin area. 59 59 * 60 * @since 1.0. 160 * @since 1.0.2 61 61 */ 62 62 public function enqueue_styles() { … … 74 74 */ 75 75 76 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/previous-next-edit-order-links-for-woocommerce-admin.css', array(), $this->version, 'all' );76 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/previous-next-edit-order-links-for-woocommerce-admin.css', array(), '1.0.21', 'all' ); 77 77 78 78 } … … 81 81 * Register the JavaScript for the admin area. 82 82 * 83 * @since 1.0. 183 * @since 1.0.2 84 84 */ 85 85 public function enqueue_scripts() { … … 100 100 $screen_id = false; 101 101 $final_prev_next_output = array("prev"=>0,"next"=>0); 102 global $post; 103 102 global $post; 104 103 if ( function_exists( 'get_current_screen' ) ) { 104 105 $screen = get_current_screen(); 106 107 $screen_id = isset( $screen, $screen->id ) ? $screen->id : ''; 108 105 109 106 $screen = get_current_screen(); 107 $screen_id = isset( $screen, $screen->id ) ? $screen->id : ''; 108 if ( $screen_id == 'shop_order' ) { 109 110 if ( $screen_id == 'woocommerce_page_wc-orders' 111 && get_option( 'woocommerce_custom_orders_table_enabled' ) == "yes" 112 && $_GET['action'] == 'edit' 113 ) 114 { 110 115 global $post, $wpdb, $theorder; 116 117 $order_navigation = $wpdb->get_row( $wpdb->prepare( " 118 SELECT 119 (SELECT ID FROM {$wpdb->prefix}wc_orders 120 WHERE id < %d 121 AND type = '%s' 122 AND status <> 'trash' 123 ORDER BY ID DESC LIMIT 1 ) 124 AS prev_order_id, 125 (SELECT ID FROM {$wpdb->prefix}wc_orders 126 WHERE id > %d 127 AND type = '%s' 128 AND status <> 'trash' 129 ORDER BY ID ASC LIMIT 1 ) 130 AS next_order_id 131 ", $theorder->get_id(), 'shop_order', $theorder->ID, 'shop_order' ), ARRAY_A ); 132 } 133 else if( $screen_id == 'shop_order' 134 && get_option( 'woocommerce_custom_orders_table_enabled' ) == "no"){ 135 global $post, $wpdb, $theorder; 111 136 112 137 if ( ! is_object( $theorder ) ) { 113 138 $theorder = wc_get_order( $post->ID ); 114 } 115 116 $order_type_object = get_post_type_object( $post->post_type ); 117 139 } 140 118 141 $order_navigation = $wpdb->get_row( $wpdb->prepare( " 119 142 SELECT … … 131 154 AS next_order_id 132 155 ", $post->ID, $post->post_type, $post->ID, $post->post_type ), ARRAY_A ); 156 157 } 158 159 160 161 162 133 163 134 164 //Filling the Output array--------- 135 if ( array_filter( $order_navigation ) ) : 136 137 endif; 165 166 if(!empty($order_navigation[ 'prev_order_id' ])){ 167 $final_prev_next_output["prev"] = admin_url( 'post.php?post='.$order_navigation[ 'prev_order_id' ].'&action=edit' ); 168 } 169 if(!empty($order_navigation[ 'next_order_id' ])){ 170 $final_prev_next_output["next"] = admin_url( 'post.php?post='.$order_navigation[ 'next_order_id' ].'&action=edit' ); 171 } 172 173 //Enqueuing the Output JS scripts--------- 138 174 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 } 175 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 176 'js/previous-next-edit-order-links-for-woocommerce-admin.js', array( 'jquery' ), $this->version, false ); 177 wp_localize_script($this->plugin_name, 'prev_next_script_vars', array( 178 "prev" => $final_prev_next_output["prev"], 179 "prev_text" => __('Previous Order','belo_prev_next_domain'), 180 "next" => $final_prev_next_output["next"], 181 "next_text" => __('Next Order','belo_prev_next_domain') 182 ) 183 ); 159 184 } 160 185 -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/admin/css/previous-next-edit-order-links-for-woocommerce-admin.css
r2878036 r2986962 3 3 * included in this file. 4 4 */ 5 .belo_prev_next {6 width: 100%;7 display: flex;8 justify-content: space-between;9 margin-bottom: 30px;5 .belo_prev_next { 6 width: 100%; 7 display: flex; 8 justify-content: space-between; 9 margin-bottom: 30px; 10 10 } 11 11 .belo_prev_next { 12 width: 100%;12 width: 100%; 13 13 } 14 14 15 15 .prev_buttn { 16 float: left !important; 17 color: #fff !important; 18 background: linear-gradient(0deg, rgb(36 66 188) 0%, rgb(0 153 255) 100%) !important; 19 border: none; 20 border-radius: 5px; 21 padding: 10px 25px; 22 font-family: 'Lato', sans-serif; 23 font-weight: 500; 24 background: transparent; 25 cursor: pointer; 26 transition: all 0.3s ease; 27 position: relative; 28 display: inline-block; 29 box-shadow: inset 2px 2px 2px 0px rgb(255 255 255 / 50%), 7px 7px 20px 0px rgb(0 0 0 / 10%), 4px 4px 5px 0px rgb(0 0 0 / 10%); 30 outline: none; 31 } 32 .prev_buttn:hover, .next_buttn:hover{ 33 background: linear-gradient(175deg, rgb(36 66 188) 0%, rgb(0 153 255) 100%) !important; 16 float: left !important; 17 border: none; 18 border-radius: 5px; 19 padding: 10px 25px; 20 font-family: "Lato", sans-serif; 21 font-weight: 500; 22 cursor: pointer; 23 transition: all 0.3s ease; 24 position: relative; 25 display: inline-block; 26 outline: none; 34 27 } 35 28 36 .next_buttn{ 37 float: right !important; 38 color: #fff !important; 39 background: linear-gradient(0deg, rgb(36 66 188) 0%, rgb(0 153 255) 100%) !important; 40 border: none; 41 border-radius: 5px; 42 padding: 10px 25px; 43 font-family: 'Lato', sans-serif; 44 font-weight: 500; 45 background: transparent; 46 cursor: pointer; 47 transition: all 0.3s ease; 48 position: relative; 49 display: inline-block; 50 box-shadow: inset 2px 2px 2px 0px rgb(255 255 255 / 50%), 7px 7px 20px 0px rgb(0 0 0 / 10%), 4px 4px 5px 0px rgb(0 0 0 / 10%); 51 outline: none; 29 .next_buttn { 30 float: right !important; 31 border: none; 32 border-radius: 5px; 33 padding: 10px 25px; 34 font-family: "Lato", sans-serif; 35 font-weight: 500; 36 cursor: pointer; 37 transition: all 0.3s ease; 38 position: relative; 39 display: inline-block; 40 outline: none; 52 41 } 53 42 .belo_link_buttons { 54 display: flex !important; 55 justify-content: center !important; 56 align-items: center !important; 57 color: white !important; 58 min-width: 120px !important; 43 display: flex !important; 44 justify-content: center !important; 45 align-items: center !important; 46 min-width: 120px !important; 59 47 } 60 48 61 49 .belo_link_buttons:focus { 62 box-shadow: none !important;63 outline: none !important;64 text-decoration: none !important;65 display: flex;66 justify-content: center;67 align-items: center;50 box-shadow: none !important; 51 outline: none !important; 52 text-decoration: none !important; 53 display: flex; 54 justify-content: center; 55 align-items: center; 68 56 } 69 57 70 58 .belo_link_buttons.next::after { 71 font-family: Dashicons;72 font-weight: 400;73 font-size: 20px;74 text-align: center;75 content: "\f345";76 line-height: 28px;59 font-family: Dashicons; 60 font-weight: 400; 61 font-size: 20px; 62 text-align: center; 63 content: "\f345"; 64 line-height: 28px; 77 65 } 78 66 79 67 .belo_link_buttons.prev::before { 80 font-family: Dashicons;81 font-weight: 400;82 font-size: 20px;83 text-align: center;84 content: "\f341";85 line-height: 28px;68 font-family: Dashicons; 69 font-weight: 400; 70 font-size: 20px; 71 text-align: center; 72 content: "\f341"; 73 line-height: 28px; 86 74 } -
admin-previous-and-next-order-edit-links-for-woocommerce/trunk/previous-next-edit-order-links-for-woocommerce.php
r2932985 r2986962 89 89 * 90 90 * @since 1.0.1 91 */ 91 */ 92 92 function run_previous_next_edit_order_links_for_woocommerce() { 93 93
Note: See TracChangeset
for help on using the changeset viewer.