From ee7f1935c4c715c0c26af60f4541e0793c3adc80 Mon Sep 17 00:00:00 2001 From: paul sealock Date: Wed, 4 Sep 2024 14:07:08 +1200 Subject: [PATCH] handle query omission --- plugins/woocommerce-admin/client/settings/index.js | 1 - plugins/woocommerce-admin/client/settings/tabs.js | 5 ++++- .../includes/admin/settings/class-wc-settings-page.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce-admin/client/settings/index.js b/plugins/woocommerce-admin/client/settings/index.js index 3fb35761878..0ed1ce37f3b 100644 --- a/plugins/woocommerce-admin/client/settings/index.js +++ b/plugins/woocommerce-admin/client/settings/index.js @@ -56,7 +56,6 @@ const removeSettingsScripts = ( scripts ) => { }; const Settings = ( { params } ) => { - console.log( params ); useFullScreen( [ 'woocommerce-settings' ] ); const settingsData = window.wcSettings?.admin?.settingsPages; const sections = settingsData[ params.page ]?.sections; diff --git a/plugins/woocommerce-admin/client/settings/tabs.js b/plugins/woocommerce-admin/client/settings/tabs.js index 80d6601cb1a..348233b1ae5 100644 --- a/plugins/woocommerce-admin/client/settings/tabs.js +++ b/plugins/woocommerce-admin/client/settings/tabs.js @@ -7,7 +7,9 @@ import { getNewPath, navigateTo } from '@woocommerce/navigation'; export const Tabs = ( { data, page, children } ) => { const onSelect = ( tabName ) => { const url = getNewPath( {}, `/settings/${ tabName }`, {} ); - navigateTo( { url } ); + if ( page !== tabName ) { + navigateTo( { url } ); + } }; return ( @@ -22,6 +24,7 @@ export const Tabs = ( { data, page, children } ) => { name: key, title: data[ key ].label, } ) ) } + selectOnMove={ false } > { () =>
{ children }
} diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php index c7e24f6a844..53ea5188011 100644 --- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php +++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php @@ -173,7 +173,7 @@ if ( ! class_exists( 'WC_Settings_Page', false ) ) : $tags = new WP_HTML_Tag_Processor( $html ); while( $tags->next_tag( array( 'tag_name' => 'script' ) ) ) { $script_type = $tags->get_attribute( 'type' ); - if ( 'text/html' !== $script_type ) { + if ( 'text/javascript' === $script_type ) { $script_contents = $tags->get_modifiable_text(); $section_settings_data[] = array( 'type' => 'script',