From 59c1b2f669d74fa47551919469bbddac89e4c5c0 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Thu, 29 Nov 2018 16:16:51 -0400 Subject: [PATCH] phpcs sniff fixes class-wc-admin-list-table-orders.php --- .../class-wc-admin-list-table-orders.php | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/includes/admin/list-tables/class-wc-admin-list-table-orders.php b/includes/admin/list-tables/class-wc-admin-list-table-orders.php index 1b562292c2a..fa9e6f86c21 100644 --- a/includes/admin/list-tables/class-wc-admin-list-table-orders.php +++ b/includes/admin/list-tables/class-wc-admin-list-table-orders.php @@ -422,7 +422,8 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { */ public static function get_order_preview_item_html( $order ) { $hidden_order_itemmeta = apply_filters( - 'woocommerce_hidden_order_itemmeta', array( + 'woocommerce_hidden_order_itemmeta', + array( '_qty', '_tax_class', '_product_id', @@ -439,12 +440,14 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { $line_items = apply_filters( 'woocommerce_admin_order_preview_line_items', $order->get_items(), $order ); $columns = apply_filters( - 'woocommerce_admin_order_preview_line_item_columns', array( + 'woocommerce_admin_order_preview_line_item_columns', + array( 'product' => __( 'Product', 'woocommerce' ), 'quantity' => __( 'Quantity', 'woocommerce' ), 'tax' => __( 'Tax', 'woocommerce' ), 'total' => __( 'Total', 'woocommerce' ), - ), $order + ), + $order ); if ( ! wc_tax_enabled() ) { @@ -602,11 +605,12 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { $shipping_address = $order->get_formatted_shipping_address(); return apply_filters( - 'woocommerce_admin_order_preview_get_order_details', array( + 'woocommerce_admin_order_preview_get_order_details', + array( 'data' => $order->get_data(), 'order_number' => $order->get_order_number(), - 'item_html' => WC_Admin_List_Table_Orders::get_order_preview_item_html( $order ), - 'actions_html' => WC_Admin_List_Table_Orders::get_order_preview_actions_html( $order ), + 'item_html' => self::get_order_preview_item_html( $order ), + 'actions_html' => self::get_order_preview_actions_html( $order ), 'ship_to_billing' => wc_ship_to_billing_address_only(), 'needs_shipping' => $order->needs_shipping_address(), 'formatted_billing_address' => $billing_address ? $billing_address : __( 'N/A', 'woocommerce' ), @@ -616,7 +620,8 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { 'shipping_via' => $order->get_shipping_method(), 'status' => $order->get_status(), 'status_name' => wc_get_order_status_name( $order->get_status() ), - ), $order + ), + $order ); } @@ -669,7 +674,8 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { 'bulk_action' => $report_action, 'changed' => $changed, 'ids' => join( ',', $ids ), - ), $redirect_to + ), + $redirect_to ); } @@ -726,7 +732,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { $user_string = ''; $user_id = ''; - if ( ! empty( $_GET['_customer_user'] ) ) { // WPCS: input var ok. + if ( ! empty( $_GET['_customer_user'] ) ) { // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification $user_id = absint( $_GET['_customer_user'] ); // WPCS: input var ok, sanitization ok. $user = get_user_by( 'id', $user_id ); @@ -772,11 +778,11 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { // Filter the orders by the posted customer. if ( ! empty( $_GET['_customer_user'] ) ) { // WPCS: input var ok. - // @codingStandardsIgnoreStart + // @codingStandardsIgnoreStart. $query_vars['meta_query'] = array( array( - 'key' => '_customer_user', - 'value' => (int) $_GET['_customer_user'], // WPCS: input var ok, sanitization ok. + 'key' => '_customer_user', + 'value' => (int) $_GET['_customer_user'], // WPCS: input var ok, sanitization ok. 'compare' => '=', ), ); @@ -819,7 +825,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { public function search_label( $query ) { global $pagenow, $typenow; - if ( 'edit.php' !== $pagenow || 'shop_order' !== $typenow || ! get_query_var( 'shop_order_search' ) || ! isset( $_GET['s'] ) ) { // WPCS: input var ok. + if ( 'edit.php' !== $pagenow || 'shop_order' !== $typenow || ! get_query_var( 'shop_order_search' ) || ! isset( $_GET['s'] ) ) { // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification return $query; } @@ -845,7 +851,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { public function search_custom_fields( $wp ) { global $pagenow; - if ( 'edit.php' !== $pagenow || empty( $wp->query_vars['s'] ) || 'shop_order' !== $wp->query_vars['post_type'] || ! isset( $_GET['s'] ) ) { // WPCS: input var ok. + if ( 'edit.php' !== $pagenow || empty( $wp->query_vars['s'] ) || 'shop_order' !== $wp->query_vars['post_type'] || ! isset( $_GET['s'] ) ) { // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification return; }