File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ const AdminPage = () => {
24
24
const closeChangelogModal = ( ) => setIsChangelogModalOpen ( false ) ;
25
25
26
26
useEffect ( ( ) => {
27
- let restUrl = `/wp-json/wp-rollback/v1/fetch-info/?type=${ queryArgs . type } &slug=${ queryArgs . type === 'theme' ? queryArgs . theme_file : queryArgs . plugin_slug } ` ;
27
+
28
+ let restUrl = `${ wprData . baseUrl } /wp-json/wp-rollback/v1/fetch-info/?type=${ queryArgs . type } &slug=${ queryArgs . type === 'theme' ? queryArgs . theme_file : queryArgs . plugin_slug } ` ;
29
+
30
+
28
31
29
32
fetch ( restUrl )
30
33
. then ( ( response ) => response . json ( ) )
Original file line number Diff line number Diff line change @@ -273,6 +273,7 @@ public function scripts( $hook ): void {
273
273
wp_localize_script ( 'wp-rollback-plugin-admin-editor ' , 'wprData ' , [
274
274
'rollback_nonce ' => wp_create_nonce ( 'wpr_rollback_nonce ' ),
275
275
'adminUrl ' => admin_url ( 'index.php ' ),
276
+ 'baseUrl ' => get_site_url (),
276
277
'logo ' => plugins_url ( 'src/assets/logo.svg ' , __FILE__ ),
277
278
'avatarFallback ' => plugins_url ( 'src/assets/avatar-plugin-fallback.jpg ' , __FILE__ ),
278
279
'referrer ' => wp_get_referer (),
You can’t perform that action at this time.
0 commit comments