From 68c147a4916b507037457f4b264ba46a6adfeb3c Mon Sep 17 00:00:00 2001
From: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Date: Thu, 4 Jan 2024 16:08:31 -0800
Subject: [PATCH] Settings: Make minor corrections to the HTML markup of
settings fields (#43166)
* Corrections to HTML markup of settings controls
* Remove deprecated `valign` attributes from table row elements
* Remove orphaned quotation marks from the end of table row elements
Co-authored-by: Sagehen Studio <2924107+sagehenstudio@users.noreply.github.com>
* Enable title prop for `info` setting type
This gives the `
` for the info setting type a closing tag
since its not self-closing. It also allows for adding a `title` prop
to the info setting type, to match all the other setting types.
* Add changelog file
* phpcs cleanup
---------
Co-authored-by: Sagehen Studio <2924107+sagehenstudio@users.noreply.github.com>
---
.../changelog/remix-41077-settings-html-fixes | 4 ++
.../admin/class-wc-admin-settings.php | 42 ++++++++++++-------
2 files changed, 31 insertions(+), 15 deletions(-)
create mode 100644 plugins/woocommerce/changelog/remix-41077-settings-html-fixes
diff --git a/plugins/woocommerce/changelog/remix-41077-settings-html-fixes b/plugins/woocommerce/changelog/remix-41077-settings-html-fixes
new file mode 100644
index 00000000000..abeadae0e22
--- /dev/null
+++ b/plugins/woocommerce/changelog/remix-41077-settings-html-fixes
@@ -0,0 +1,4 @@
+Significance: minor
+Type: update
+
+Make minor corrections to the HTML markup of settings fields
diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-settings.php b/plugins/woocommerce/includes/admin/class-wc-admin-settings.php
index a0ec737087e..a322828e5b2 100644
--- a/plugins/woocommerce/includes/admin/class-wc-admin-settings.php
+++ b/plugins/woocommerce/includes/admin/class-wc-admin-settings.php
@@ -253,6 +253,11 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
$value['value'] = self::get_option( $value['id'], $value['default'] );
}
+ $row_class_attribute = '';
+ if ( $value['row_class'] ) {
+ $row_class_attribute = " class=\"{$value['row_class']}\"";
+ }
+
// Custom attribute handling.
$custom_attributes = array();
@@ -287,8 +292,9 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
break;
case 'info':
- ?>