Socket
Socket
Sign inDemoInstall

@wordpress/api-fetch

Package Overview
Dependencies
Maintainers
25
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/api-fetch - npm Package Compare versions

Comparing version 6.32.0 to 6.32.1

10

build-module/middlewares/theme-preview.js

@@ -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 @@ }

{
"name": "@wordpress/api-fetch",
"version": "6.32.0",
"version": "6.32.1",
"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.35.1",
"@wordpress/url": "^3.36.1"
},

@@ -38,3 +38,3 @@ "publishConfig": {

},
"gitHead": "a92f606309b1541b834ff9b0a76ed2a466fc45ed"
"gitHead": "ce5639111c30763dbdf07f40eeb136ea6030ecf1"
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc