From 3aa67ac352a8dc80e731580fc573df0ab8ffe850 Mon Sep 17 00:00:00 2001 From: shivapoudel Date: Thu, 27 Nov 2014 22:32:11 +0545 Subject: [PATCH 1/2] Fixes attribute menu highlight, closes #6849 --- includes/admin/class-wc-admin-attributes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/admin/class-wc-admin-attributes.php b/includes/admin/class-wc-admin-attributes.php index 257020644da..53dfc16e4bd 100644 --- a/includes/admin/class-wc-admin-attributes.php +++ b/includes/admin/class-wc-admin-attributes.php @@ -233,7 +233,7 @@ class WC_Admin_Attributes {

-
+ @@ -323,7 +323,7 @@ class WC_Admin_Attributes { @@ -384,7 +384,7 @@ class WC_Admin_Attributes {

- +
From 84bc7a2339812d58e46164d665c284a70b6529bd Mon Sep 17 00:00:00 2001 From: shivapoudel Date: Thu, 27 Nov 2014 22:34:19 +0545 Subject: [PATCH 2/2] Cleanup for WC_Admin_Attributes Class --- includes/admin/class-wc-admin-attributes.php | 166 ++++++++++--------- 1 file changed, 84 insertions(+), 82 deletions(-) diff --git a/includes/admin/class-wc-admin-attributes.php b/includes/admin/class-wc-admin-attributes.php index 53dfc16e4bd..6694de59092 100644 --- a/includes/admin/class-wc-admin-attributes.php +++ b/includes/admin/class-wc-admin-attributes.php @@ -4,14 +4,14 @@ * * The attributes section lets users add custom attributes to assign to products - they can also be used in the layered nav widget. * - * @author WooThemes - * @category Admin - * @package WooCommerce/Admin - * @version 2.1.0 + * @author WooThemes + * @category Admin + * @package WooCommerce/Admin + * @version 2.3.0 */ if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly + exit; } /** @@ -23,7 +23,7 @@ class WC_Admin_Attributes { * Handles output of the attributes page in admin. * * Shows the created attributes and lets you add new ones or edit existing ones. - * The added attributes are stored in the database and can be used for layered navigation. + * The added attributes are stored in the database and can be used for layered navigation. */ public static function output() { global $wpdb; @@ -232,7 +232,7 @@ class WC_Admin_Attributes { ?>

-

+

attribute_label ); ?> -
|
+
|
attribute_name ); ?> attribute_type ) ); ?>
@@ -299,57 +299,57 @@ class WC_Admin_Attributes { ?>

-

-
-
-
-
-
- - - - - - - - - - - +

+
+
+
+
+
+ + + + + + + + + + + - - - - - + + + + - - - -
attribute_label ); ?> + attribute_label ); ?> -
|
-
attribute_name ); ?>attribute_type ) ); ?>attribute_orderby ) { - case 'name' : - _e( 'Name', 'woocommerce' ); - break; - case 'name_num' : - _e( 'Name (numeric)', 'woocommerce' ); - break; - case 'id' : - _e( 'Term ID', 'woocommerce' ); - break; - default: - _e( 'Custom ordering', 'woocommerce' ); - break; - } - ?>attribute_name ); +
|
+
attribute_name ); ?>attribute_type ) ); ?>attribute_orderby ) { + case 'name' : + _e( 'Name', 'woocommerce' ); + break; + case 'name_num' : + _e( 'Name (numeric)', 'woocommerce' ); + break; + case 'id' : + _e( 'Term ID', 'woocommerce' ); + break; + default: + _e( 'Custom ordering', 'woocommerce' ); + break; + } + ?>attribute_name ); - if ( taxonomy_exists( $taxonomy ) ) { - $terms = get_terms( $taxonomy, 'hide_empty=0' ); + if ( taxonomy_exists( $taxonomy ) ) { + $terms = get_terms( $taxonomy, 'hide_empty=0' ); - switch ( $tax->attribute_orderby ) { + switch ( $tax->attribute_orderby ) { case 'name_num' : usort( $terms, '_wc_get_product_terms_name_num_usort_callback' ); break; @@ -367,24 +367,24 @@ class WC_Admin_Attributes { } else { echo ''; } - ?>
-
- -
-
-
-

-

- + ?> + + + + +
+
+
+
+
+

+

+
@@ -419,19 +419,21 @@ class WC_Admin_Attributes {

- -
-
-
-
-