@wordpress/api-fetch
Advanced tools
Comparing version 6.32.0 to 6.33.0
@@ -6,3 +6,3 @@ /** | ||
/** | ||
* This appends a `theme_preview` parameter to the REST API request URL if | ||
* This appends a `wp_theme_preview` parameter to the REST API request URL if | ||
* the admin URL contains a `theme` GET parameter. | ||
@@ -15,11 +15,11 @@ * | ||
const createThemePreviewMiddleware = themePath => (options, next) => { | ||
if (typeof options.url === 'string' && !hasQueryArg(options.url, 'theme_preview')) { | ||
if (typeof options.url === 'string' && !hasQueryArg(options.url, 'wp_theme_preview')) { | ||
options.url = addQueryArgs(options.url, { | ||
theme_preview: themePath | ||
wp_theme_preview: themePath | ||
}); | ||
} | ||
if (typeof options.path === 'string' && !hasQueryArg(options.path, 'theme_preview')) { | ||
if (typeof options.path === 'string' && !hasQueryArg(options.path, 'wp_theme_preview')) { | ||
options.path = addQueryArgs(options.path, { | ||
theme_preview: themePath | ||
wp_theme_preview: themePath | ||
}); | ||
@@ -26,0 +26,0 @@ } |
export default createThemePreviewMiddleware; | ||
/** | ||
* This appends a `theme_preview` parameter to the REST API request URL if | ||
* This appends a `wp_theme_preview` parameter to the REST API request URL if | ||
* the admin URL contains a `theme` GET parameter. | ||
@@ -5,0 +5,0 @@ * |
@@ -15,3 +15,3 @@ "use strict"; | ||
/** | ||
* This appends a `theme_preview` parameter to the REST API request URL if | ||
* This appends a `wp_theme_preview` parameter to the REST API request URL if | ||
* the admin URL contains a `theme` GET parameter. | ||
@@ -23,11 +23,11 @@ * | ||
const createThemePreviewMiddleware = themePath => (options, next) => { | ||
if (typeof options.url === 'string' && !(0, _url.hasQueryArg)(options.url, 'theme_preview')) { | ||
if (typeof options.url === 'string' && !(0, _url.hasQueryArg)(options.url, 'wp_theme_preview')) { | ||
options.url = (0, _url.addQueryArgs)(options.url, { | ||
theme_preview: themePath | ||
wp_theme_preview: themePath | ||
}); | ||
} | ||
if (typeof options.path === 'string' && !(0, _url.hasQueryArg)(options.path, 'theme_preview')) { | ||
if (typeof options.path === 'string' && !(0, _url.hasQueryArg)(options.path, 'wp_theme_preview')) { | ||
options.path = (0, _url.addQueryArgs)(options.path, { | ||
theme_preview: themePath | ||
wp_theme_preview: themePath | ||
}); | ||
@@ -34,0 +34,0 @@ } |
@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. --> | ||
## 6.33.0 (2023-06-23) | ||
## 6.32.0 (2023-06-07) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "@wordpress/api-fetch", | ||
"version": "6.32.0", | ||
"version": "6.33.0", | ||
"description": "Utility to make WordPress REST API requests.", | ||
@@ -31,4 +31,4 @@ "author": "The WordPress Contributors", | ||
"@babel/runtime": "^7.16.0", | ||
"@wordpress/i18n": "^4.35.0", | ||
"@wordpress/url": "^3.36.0" | ||
"@wordpress/i18n": "^4.36.0", | ||
"@wordpress/url": "^3.37.0" | ||
}, | ||
@@ -38,3 +38,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "a92f606309b1541b834ff9b0a76ed2a466fc45ed" | ||
"gitHead": "d47d8069e1aae05d4a16dc287902eb90edcbff50" | ||
} |
@@ -7,3 +7,3 @@ /** | ||
/** | ||
* This appends a `theme_preview` parameter to the REST API request URL if | ||
* This appends a `wp_theme_preview` parameter to the REST API request URL if | ||
* the admin URL contains a `theme` GET parameter. | ||
@@ -17,6 +17,6 @@ * | ||
typeof options.url === 'string' && | ||
! hasQueryArg( options.url, 'theme_preview' ) | ||
! hasQueryArg( options.url, 'wp_theme_preview' ) | ||
) { | ||
options.url = addQueryArgs( options.url, { | ||
theme_preview: themePath, | ||
wp_theme_preview: themePath, | ||
} ); | ||
@@ -27,6 +27,6 @@ } | ||
typeof options.path === 'string' && | ||
! hasQueryArg( options.path, 'theme_preview' ) | ||
! hasQueryArg( options.path, 'wp_theme_preview' ) | ||
) { | ||
options.path = addQueryArgs( options.path, { | ||
theme_preview: themePath, | ||
wp_theme_preview: themePath, | ||
} ); | ||
@@ -33,0 +33,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242210
Updated@wordpress/i18n@^4.36.0
Updated@wordpress/url@^3.37.0