More phpcs

This commit is contained in:
Will Gorham 2018-11-16 14:47:31 -05:00
parent bc4010cfc1
commit b53fe55299
1 changed files with 24 additions and 15 deletions

View File

@ -293,11 +293,14 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
* Render any custom filters and search inputs for the list table.
*/
protected function render_filters() {
$filters = apply_filters( 'woocommerce_products_admin_list_table_filters', array(
'product_category' => array( $this, 'render_products_category_filter' ),
'product_type' => array( $this, 'render_products_type_filter' ),
'stock_status' => array( $this, 'render_products_stock_status_filter' ),
) );
$filters = apply_filters(
'woocommerce_products_admin_list_table_filters',
array(
'product_category' => array( $this, 'render_products_category_filter' ),
'product_type' => array( $this, 'render_products_type_filter' ),
'stock_status' => array( $this, 'render_products_stock_status_filter' ),
)
);
ob_start();
foreach ( $filters as $filter_callback ) {
@ -394,18 +397,24 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
protected function query_filters( $query_vars ) {
if ( isset( $query_vars['orderby'] ) ) {
if ( 'price' === $query_vars['orderby'] ) {
$query_vars = array_merge( $query_vars, array(
// phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
'meta_key' => '_price',
'orderby' => 'meta_value_num',
) );
$query_vars = array_merge(
$query_vars,
array(
// phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
'meta_key' => '_price',
'orderby' => 'meta_value_num',
)
);
}
if ( 'sku' === $query_vars['orderby'] ) {
$query_vars = array_merge( $query_vars, array(
// phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
'meta_key' => '_sku',
'orderby' => 'meta_value',
) );
$query_vars = array_merge(
$query_vars,
array(
// phpcs:ignore WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
'meta_key' => '_sku',
'orderby' => 'meta_value',
)
);
}
}