From 134f9c9c8eee3647993e44bba213e987d11f70d5 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Mon, 15 Apr 2019 12:13:02 +0200 Subject: [PATCH] Fix PHPCS --- .../settings/class-wc-settings-products.php | 22 ++++++++++++------- includes/class-wc-checkout.php | 16 +++++++------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/includes/admin/settings/class-wc-settings-products.php b/includes/admin/settings/class-wc-settings-products.php index 14f92cfae37..c3c97523958 100644 --- a/includes/admin/settings/class-wc-settings-products.php +++ b/includes/admin/settings/class-wc-settings-products.php @@ -76,17 +76,20 @@ class WC_Settings_Products extends WC_Settings_Page { echo wp_kses( sprintf( /* translators: %s: URL to customizer. */ - __( 'Looking for the product display options? They can now be found in the Customizer. Go see them in action here.', 'woocommerce' ), esc_url( + __( 'Looking for the product display options? They can now be found in the Customizer. Go see them in action here.', 'woocommerce' ), + esc_url( add_query_arg( array( 'autofocus' => array( 'panel' => 'woocommerce', ), 'url' => wc_get_page_permalink( 'shop' ), - ), admin_url( 'customize.php' ) + ), + admin_url( 'customize.php' ) ) ) - ), array( + ), + array( 'a' => array( 'href' => array(), 'title' => array(), @@ -122,8 +125,8 @@ class WC_Settings_Products extends WC_Settings_Page { public function get_settings( $current_section = '' ) { if ( 'inventory' === $current_section ) { $settings = apply_filters( - 'woocommerce_inventory_settings', array( - + 'woocommerce_inventory_settings', + array( array( 'title' => __( 'Inventory', 'woocommerce' ), 'type' => 'title', @@ -252,7 +255,8 @@ class WC_Settings_Products extends WC_Settings_Page { } elseif ( 'downloadable' === $current_section ) { $settings = apply_filters( - 'woocommerce_downloadable_products_settings', array( + 'woocommerce_downloadable_products_settings', + array( array( 'title' => __( 'Downloadable products', 'woocommerce' ), 'type' => 'title', @@ -313,8 +317,10 @@ class WC_Settings_Products extends WC_Settings_Page { } else { $settings = apply_filters( - 'woocommerce_product_settings', apply_filters( - 'woocommerce_products_general_settings', array( + 'woocommerce_product_settings', + apply_filters( + 'woocommerce_products_general_settings', + array( array( 'title' => __( 'Shop pages', 'woocommerce' ), 'type' => 'title', diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index eaab4e52131..3636a75ee4a 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -267,14 +267,14 @@ class WC_Checkout { foreach ( $this->fields as $field_type => $fields ) { // Sort each of the checkout field sections based on priority. uasort( $this->fields[ $field_type ], 'wc_checkout_fields_uasort_comparison' ); - - //add accessibility labels to fields that have placeholders - foreach ( $fields as $single_field_type => $field) { - if ( empty( $field[ 'label' ] ) && !empty( $field[ 'placeholder' ] )) { - $this->fields[ $field_type ][ $single_field_type ][ 'label' ] = $field[ 'placeholder' ]; - $this->fields[ $field_type ][ $single_field_type ][ 'label_class' ] = 'screen-reader-text'; - } - } + + // Add accessibility labels to fields that have placeholders. + foreach ( $fields as $single_field_type => $field ) { + if ( empty( $field['label'] ) && ! empty( $field['placeholder'] ) ) { + $this->fields[ $field_type ][ $single_field_type ]['label'] = $field['placeholder']; + $this->fields[ $field_type ][ $single_field_type ]['label_class'] = 'screen-reader-text'; + } + } } return $fieldset ? $this->fields[ $fieldset ] : $this->fields;