Shipping Settings: Replace tables only for use in modals (#42795)
This commit is contained in:
commit
4e98801e8f
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Revert Shipping Settings change of replacing tables, replace only for use in JS powered modals.
|
|
@ -510,11 +510,13 @@
|
|||
// `<table class="form-table" />` elements added by the Settings API need to be removed.
|
||||
// Modern browsers won't interpret other table elements like `td` not in a `table`, so
|
||||
// Removing the `table` is sufficient.
|
||||
const htmlContent = $( html );
|
||||
const tables = htmlContent.find( 'table.form-table' );
|
||||
const originalTable = $( html );
|
||||
const htmlContent = $( '<div class="wc-shipping-zone-method-fields" />' );
|
||||
htmlContent.html( originalTable.html() );
|
||||
|
||||
tables.each( ( i ) => {
|
||||
const table = $( tables[ i ] );
|
||||
const innerTables = htmlContent.find( 'table.form-table' );
|
||||
innerTables.each( ( i ) => {
|
||||
const table = $( innerTables[ i ] );
|
||||
const div = $( '<div class="wc-shipping-zone-method-fields" />' );
|
||||
div.html( table.html() );
|
||||
table.replaceWith( div );
|
||||
|
|
|
@ -460,7 +460,7 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
|
|||
$settings_html = $this->generate_settings_html( $this->get_form_fields(), false );
|
||||
}
|
||||
|
||||
return '<div class="wc-shipping-zone-method-fields">' . $settings_html . '</div>';
|
||||
return '<table class="form-table">' . $settings_html . '</table>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue