diff --git a/plugins/woocommerce-admin/client/settings/pages/my-example/index.js b/plugins/woocommerce-admin/client/settings/pages/my-example/index.js index dc787cac9b2..8c18ba61ed7 100644 --- a/plugins/woocommerce-admin/client/settings/pages/my-example/index.js +++ b/plugins/woocommerce-admin/client/settings/pages/my-example/index.js @@ -8,7 +8,6 @@ import { useSettingsLocation } from '../../routes'; */ import { getNewPath } from '@woocommerce/navigation'; import { Link } from '@woocommerce/components'; -import { addFilter } from '@wordpress/hooks'; export const MyExample = () => { const { section } = useSettingsLocation(); @@ -32,20 +31,3 @@ export const MyExampleEdit = () => { ); }; - -addFilter( 'woocommerce_admin_settings_pages', 'woocommerce', ( pages ) => { - return [ - ...pages, - { - page: 'my-example', - areas: { - content: , - edit: , - }, - widths: { - content: undefined, - edit: 380, - }, - }, - ]; -} ); diff --git a/plugins/woocommerce-admin/client/settings/routes.js b/plugins/woocommerce-admin/client/settings/routes.js index abfee638cb0..468a5b528ef 100644 --- a/plugins/woocommerce-admin/client/settings/routes.js +++ b/plugins/woocommerce-admin/client/settings/routes.js @@ -2,12 +2,13 @@ * External dependencies */ import { getQuery } from '@woocommerce/navigation'; -import { applyFilters } from '@wordpress/hooks'; +import { applyFilters, addFilter } from '@wordpress/hooks'; /** * Internal dependencies */ import { Content } from './content'; +import { MyExample, MyExampleEdit } from './pages/my-example'; const NotFound = () => { return

Not Found

; @@ -60,6 +61,23 @@ export const getRoute = () => { }; } + addFilter( 'woocommerce_admin_settings_pages', 'woocommerce', ( pages ) => { + return [ + ...pages, + { + page: 'my-example', + areas: { + content: , + edit: , + }, + widths: { + content: undefined, + edit: 380, + }, + }, + ]; + } ); + const routes = applyFilters( 'woocommerce_admin_settings_pages', [] ); const pageRoute = routes.find( ( route ) => route.page === page ); diff --git a/plugins/woocommerce-admin/client/settings/section-nav.js b/plugins/woocommerce-admin/client/settings/section-nav.js index fe18350d617..b4f37418cd6 100644 --- a/plugins/woocommerce-admin/client/settings/section-nav.js +++ b/plugins/woocommerce-admin/client/settings/section-nav.js @@ -9,7 +9,7 @@ export const SectionNav = ( { data, section, children } ) => { const sectionKeys = Object.keys( sections ); const selectedSection = section || sectionKeys[ 0 ]; const onSelect = ( tabName ) => { - const url = getNewPath( { section: tabName } ); + const url = getNewPath( { section: tabName, quickEdit: 'false' } ); navigateTo( { url } ); };