Skip to content

Commit

Permalink
Edit Site: Append query vars in NavigateToLink properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Feb 25, 2020
1 parent fef82a7 commit 59cdd3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/edit-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@wordpress/i18n": "file:../i18n",
"@wordpress/media-utils": "file:../media-utils",
"@wordpress/notices": "file:../notices",
"@wordpress/url": "file:../url",
"file-saver": "^2.0.2",
"jszip": "^3.2.2"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/edit-site/src/components/navigate-to-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { useState, useEffect, useMemo } from '@wordpress/element';
import { addQueryArgs } from '@wordpress/url';
import { select } from '@wordpress/data';
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
Expand All @@ -22,7 +23,7 @@ export default function NavigateToLink( {
const effect = async () => {
try {
const { success, data } = await fetch(
`${ url }?_wp-find-template`
addQueryArgs( url, { '_wp-find-template': true } )
).then( ( res ) => res.json() );
if ( success ) {
let newTemplateId = data.ID;
Expand Down

0 comments on commit 59cdd3e

Please sign in to comment.