diff --git a/packages/edit-site/src/components/routes/link.js b/packages/edit-site/src/components/routes/link.js index 4423eeeb1d6e8d..a34b37943a0799 100644 --- a/packages/edit-site/src/components/routes/link.js +++ b/packages/edit-site/src/components/routes/link.js @@ -33,14 +33,17 @@ export function useLink( params, state, shouldReplace = false ) { ...Object.keys( currentArgs ) ); + let extraParams = {}; if ( isPreviewingTheme() ) { - params = { - ...params, + extraParams = { wp_theme_preview: currentlyPreviewingTheme(), }; } - const newUrl = addQueryArgs( currentUrlWithoutArgs, params ); + const newUrl = addQueryArgs( currentUrlWithoutArgs, { + ...params, + ...extraParams, + } ); return { href: newUrl,