Fix LYS private link query parameter when permalink is plain (#48425)
* Properly build URL query parameters * Changelog
This commit is contained in:
parent
a7fc9afa8e
commit
641370aa4e
|
@ -70,16 +70,23 @@ const SiteVisibility = () => {
|
|||
const [ copyLinkText, setCopyLinkText ] = useState( copyLink );
|
||||
|
||||
const getPrivateLink = () => {
|
||||
const settings = window?.wcSettings;
|
||||
const homeUrl = settings?.homeUrl;
|
||||
const urlObject = new URL( homeUrl );
|
||||
|
||||
if ( storePagesOnly === 'yes' ) {
|
||||
return (
|
||||
window?.wcSettings?.admin?.siteVisibilitySettings
|
||||
?.shop_permalink +
|
||||
'?woo-share=' +
|
||||
shareKey
|
||||
);
|
||||
const shopPermalink =
|
||||
settings?.admin?.siteVisibilitySettings?.shop_permalink;
|
||||
if ( shopPermalink ) {
|
||||
urlObject.href = shopPermalink;
|
||||
}
|
||||
}
|
||||
|
||||
return window?.wcSettings?.homeUrl + '?woo-share=' + shareKey;
|
||||
const params = new URLSearchParams( urlObject.search );
|
||||
params.set( 'woo-share', shareKey );
|
||||
urlObject.search = params.toString();
|
||||
|
||||
return urlObject.toString();
|
||||
};
|
||||
|
||||
const copyClipboardRef = useCopyToClipboard( getPrivateLink, () => {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix LYS private link URL parameter regardless of permalink settings
|
Loading…
Reference in New Issue