Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: api-fetch.js
/**
[500] Fix | Delete
* @param {string} attachmentId
[501] Fix | Delete
* @return {Promise<any>} Processed post response.
[502] Fix | Delete
*/
[503] Fix | Delete
const postProcess = attachmentId => {
[504] Fix | Delete
retries++;
[505] Fix | Delete
return next({
[506] Fix | Delete
path: `/wp/v2/media/${attachmentId}/post-process`,
[507] Fix | Delete
method: 'POST',
[508] Fix | Delete
data: {
[509] Fix | Delete
action: 'create-image-subsizes'
[510] Fix | Delete
},
[511] Fix | Delete
parse: false
[512] Fix | Delete
}).catch(() => {
[513] Fix | Delete
if (retries < maxRetries) {
[514] Fix | Delete
return postProcess(attachmentId);
[515] Fix | Delete
}
[516] Fix | Delete
next({
[517] Fix | Delete
path: `/wp/v2/media/${attachmentId}?force=true`,
[518] Fix | Delete
method: 'DELETE'
[519] Fix | Delete
});
[520] Fix | Delete
return Promise.reject();
[521] Fix | Delete
});
[522] Fix | Delete
};
[523] Fix | Delete
return next({
[524] Fix | Delete
...options,
[525] Fix | Delete
parse: false
[526] Fix | Delete
}).catch(response => {
[527] Fix | Delete
const attachmentId = response.headers.get('x-wp-upload-attachment-id');
[528] Fix | Delete
if (response.status >= 500 && response.status < 600 && attachmentId) {
[529] Fix | Delete
return postProcess(attachmentId).catch(() => {
[530] Fix | Delete
if (options.parse !== false) {
[531] Fix | Delete
return Promise.reject({
[532] Fix | Delete
code: 'post_process',
[533] Fix | Delete
message: (0,external_wp_i18n_namespaceObject.__)('Media upload failed. If this is a photo or a large image, please scale it down and try again.')
[534] Fix | Delete
});
[535] Fix | Delete
}
[536] Fix | Delete
return Promise.reject(response);
[537] Fix | Delete
});
[538] Fix | Delete
}
[539] Fix | Delete
return parseAndThrowError(response, options.parse);
[540] Fix | Delete
}).then(response => parseResponseAndNormalizeError(response, options.parse));
[541] Fix | Delete
};
[542] Fix | Delete
/* harmony default export */ const media_upload = (mediaUploadMiddleware);
[543] Fix | Delete
[544] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/theme-preview.js
[545] Fix | Delete
/**
[546] Fix | Delete
* WordPress dependencies
[547] Fix | Delete
*/
[548] Fix | Delete
[549] Fix | Delete
[550] Fix | Delete
/**
[551] Fix | Delete
* This appends a `wp_theme_preview` parameter to the REST API request URL if
[552] Fix | Delete
* the admin URL contains a `theme` GET parameter.
[553] Fix | Delete
*
[554] Fix | Delete
* If the REST API request URL has contained the `wp_theme_preview` parameter as `''`,
[555] Fix | Delete
* then bypass this middleware.
[556] Fix | Delete
*
[557] Fix | Delete
* @param {Record<string, any>} themePath
[558] Fix | Delete
* @return {import('../types').APIFetchMiddleware} Preloading middleware.
[559] Fix | Delete
*/
[560] Fix | Delete
const createThemePreviewMiddleware = themePath => (options, next) => {
[561] Fix | Delete
if (typeof options.url === 'string') {
[562] Fix | Delete
const wpThemePreview = (0,external_wp_url_namespaceObject.getQueryArg)(options.url, 'wp_theme_preview');
[563] Fix | Delete
if (wpThemePreview === undefined) {
[564] Fix | Delete
options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, {
[565] Fix | Delete
wp_theme_preview: themePath
[566] Fix | Delete
});
[567] Fix | Delete
} else if (wpThemePreview === '') {
[568] Fix | Delete
options.url = (0,external_wp_url_namespaceObject.removeQueryArgs)(options.url, 'wp_theme_preview');
[569] Fix | Delete
}
[570] Fix | Delete
}
[571] Fix | Delete
if (typeof options.path === 'string') {
[572] Fix | Delete
const wpThemePreview = (0,external_wp_url_namespaceObject.getQueryArg)(options.path, 'wp_theme_preview');
[573] Fix | Delete
if (wpThemePreview === undefined) {
[574] Fix | Delete
options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, {
[575] Fix | Delete
wp_theme_preview: themePath
[576] Fix | Delete
});
[577] Fix | Delete
} else if (wpThemePreview === '') {
[578] Fix | Delete
options.path = (0,external_wp_url_namespaceObject.removeQueryArgs)(options.path, 'wp_theme_preview');
[579] Fix | Delete
}
[580] Fix | Delete
}
[581] Fix | Delete
return next(options);
[582] Fix | Delete
};
[583] Fix | Delete
/* harmony default export */ const theme_preview = (createThemePreviewMiddleware);
[584] Fix | Delete
[585] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/index.js
[586] Fix | Delete
/**
[587] Fix | Delete
* WordPress dependencies
[588] Fix | Delete
*/
[589] Fix | Delete
[590] Fix | Delete
[591] Fix | Delete
/**
[592] Fix | Delete
* Internal dependencies
[593] Fix | Delete
*/
[594] Fix | Delete
[595] Fix | Delete
[596] Fix | Delete
[597] Fix | Delete
[598] Fix | Delete
[599] Fix | Delete
[600] Fix | Delete
[601] Fix | Delete
[602] Fix | Delete
[603] Fix | Delete
[604] Fix | Delete
[605] Fix | Delete
/**
[606] Fix | Delete
* Default set of header values which should be sent with every request unless
[607] Fix | Delete
* explicitly provided through apiFetch options.
[608] Fix | Delete
*
[609] Fix | Delete
* @type {Record<string, string>}
[610] Fix | Delete
*/
[611] Fix | Delete
const DEFAULT_HEADERS = {
[612] Fix | Delete
// The backend uses the Accept header as a condition for considering an
[613] Fix | Delete
// incoming request as a REST request.
[614] Fix | Delete
//
[615] Fix | Delete
// See: https://core.trac.wordpress.org/ticket/44534
[616] Fix | Delete
Accept: 'application/json, */*;q=0.1'
[617] Fix | Delete
};
[618] Fix | Delete
[619] Fix | Delete
/**
[620] Fix | Delete
* Default set of fetch option values which should be sent with every request
[621] Fix | Delete
* unless explicitly provided through apiFetch options.
[622] Fix | Delete
*
[623] Fix | Delete
* @type {Object}
[624] Fix | Delete
*/
[625] Fix | Delete
const DEFAULT_OPTIONS = {
[626] Fix | Delete
credentials: 'include'
[627] Fix | Delete
};
[628] Fix | Delete
[629] Fix | Delete
/** @typedef {import('./types').APIFetchMiddleware} APIFetchMiddleware */
[630] Fix | Delete
/** @typedef {import('./types').APIFetchOptions} APIFetchOptions */
[631] Fix | Delete
[632] Fix | Delete
/**
[633] Fix | Delete
* @type {import('./types').APIFetchMiddleware[]}
[634] Fix | Delete
*/
[635] Fix | Delete
const middlewares = [user_locale, namespace_endpoint, http_v1, fetch_all_middleware];
[636] Fix | Delete
[637] Fix | Delete
/**
[638] Fix | Delete
* Register a middleware
[639] Fix | Delete
*
[640] Fix | Delete
* @param {import('./types').APIFetchMiddleware} middleware
[641] Fix | Delete
*/
[642] Fix | Delete
function registerMiddleware(middleware) {
[643] Fix | Delete
middlewares.unshift(middleware);
[644] Fix | Delete
}
[645] Fix | Delete
[646] Fix | Delete
/**
[647] Fix | Delete
* Checks the status of a response, throwing the Response as an error if
[648] Fix | Delete
* it is outside the 200 range.
[649] Fix | Delete
*
[650] Fix | Delete
* @param {Response} response
[651] Fix | Delete
* @return {Response} The response if the status is in the 200 range.
[652] Fix | Delete
*/
[653] Fix | Delete
const checkStatus = response => {
[654] Fix | Delete
if (response.status >= 200 && response.status < 300) {
[655] Fix | Delete
return response;
[656] Fix | Delete
}
[657] Fix | Delete
throw response;
[658] Fix | Delete
};
[659] Fix | Delete
[660] Fix | Delete
/** @typedef {(options: import('./types').APIFetchOptions) => Promise<any>} FetchHandler*/
[661] Fix | Delete
[662] Fix | Delete
/**
[663] Fix | Delete
* @type {FetchHandler}
[664] Fix | Delete
*/
[665] Fix | Delete
const defaultFetchHandler = nextOptions => {
[666] Fix | Delete
const {
[667] Fix | Delete
url,
[668] Fix | Delete
path,
[669] Fix | Delete
data,
[670] Fix | Delete
parse = true,
[671] Fix | Delete
...remainingOptions
[672] Fix | Delete
} = nextOptions;
[673] Fix | Delete
let {
[674] Fix | Delete
body,
[675] Fix | Delete
headers
[676] Fix | Delete
} = nextOptions;
[677] Fix | Delete
[678] Fix | Delete
// Merge explicitly-provided headers with default values.
[679] Fix | Delete
headers = {
[680] Fix | Delete
...DEFAULT_HEADERS,
[681] Fix | Delete
...headers
[682] Fix | Delete
};
[683] Fix | Delete
[684] Fix | Delete
// The `data` property is a shorthand for sending a JSON body.
[685] Fix | Delete
if (data) {
[686] Fix | Delete
body = JSON.stringify(data);
[687] Fix | Delete
headers['Content-Type'] = 'application/json';
[688] Fix | Delete
}
[689] Fix | Delete
const responsePromise = window.fetch(
[690] Fix | Delete
// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.
[691] Fix | Delete
url || path || window.location.href, {
[692] Fix | Delete
...DEFAULT_OPTIONS,
[693] Fix | Delete
...remainingOptions,
[694] Fix | Delete
body,
[695] Fix | Delete
headers
[696] Fix | Delete
});
[697] Fix | Delete
return responsePromise.then(value => Promise.resolve(value).then(checkStatus).catch(response => parseAndThrowError(response, parse)).then(response => parseResponseAndNormalizeError(response, parse)), err => {
[698] Fix | Delete
// Re-throw AbortError for the users to handle it themselves.
[699] Fix | Delete
if (err && err.name === 'AbortError') {
[700] Fix | Delete
throw err;
[701] Fix | Delete
}
[702] Fix | Delete
[703] Fix | Delete
// Otherwise, there is most likely no network connection.
[704] Fix | Delete
// Unfortunately the message might depend on the browser.
[705] Fix | Delete
throw {
[706] Fix | Delete
code: 'fetch_error',
[707] Fix | Delete
message: (0,external_wp_i18n_namespaceObject.__)('You are probably offline.')
[708] Fix | Delete
};
[709] Fix | Delete
});
[710] Fix | Delete
};
[711] Fix | Delete
[712] Fix | Delete
/** @type {FetchHandler} */
[713] Fix | Delete
let fetchHandler = defaultFetchHandler;
[714] Fix | Delete
[715] Fix | Delete
/**
[716] Fix | Delete
* Defines a custom fetch handler for making the requests that will override
[717] Fix | Delete
* the default one using window.fetch
[718] Fix | Delete
*
[719] Fix | Delete
* @param {FetchHandler} newFetchHandler The new fetch handler
[720] Fix | Delete
*/
[721] Fix | Delete
function setFetchHandler(newFetchHandler) {
[722] Fix | Delete
fetchHandler = newFetchHandler;
[723] Fix | Delete
}
[724] Fix | Delete
[725] Fix | Delete
/**
[726] Fix | Delete
* @template T
[727] Fix | Delete
* @param {import('./types').APIFetchOptions} options
[728] Fix | Delete
* @return {Promise<T>} A promise representing the request processed via the registered middlewares.
[729] Fix | Delete
*/
[730] Fix | Delete
function apiFetch(options) {
[731] Fix | Delete
// creates a nested function chain that calls all middlewares and finally the `fetchHandler`,
[732] Fix | Delete
// converting `middlewares = [ m1, m2, m3 ]` into:
[733] Fix | Delete
// ```
[734] Fix | Delete
// opts1 => m1( opts1, opts2 => m2( opts2, opts3 => m3( opts3, fetchHandler ) ) );
[735] Fix | Delete
// ```
[736] Fix | Delete
const enhancedHandler = middlewares.reduceRight(( /** @type {FetchHandler} */next, middleware) => {
[737] Fix | Delete
return workingOptions => middleware(workingOptions, next);
[738] Fix | Delete
}, fetchHandler);
[739] Fix | Delete
return enhancedHandler(options).catch(error => {
[740] Fix | Delete
if (error.code !== 'rest_cookie_invalid_nonce') {
[741] Fix | Delete
return Promise.reject(error);
[742] Fix | Delete
}
[743] Fix | Delete
[744] Fix | Delete
// If the nonce is invalid, refresh it and try again.
[745] Fix | Delete
return window
[746] Fix | Delete
// @ts-ignore
[747] Fix | Delete
.fetch(apiFetch.nonceEndpoint).then(checkStatus).then(data => data.text()).then(text => {
[748] Fix | Delete
// @ts-ignore
[749] Fix | Delete
apiFetch.nonceMiddleware.nonce = text;
[750] Fix | Delete
return apiFetch(options);
[751] Fix | Delete
});
[752] Fix | Delete
});
[753] Fix | Delete
}
[754] Fix | Delete
apiFetch.use = registerMiddleware;
[755] Fix | Delete
apiFetch.setFetchHandler = setFetchHandler;
[756] Fix | Delete
apiFetch.createNonceMiddleware = nonce;
[757] Fix | Delete
apiFetch.createPreloadingMiddleware = preloading;
[758] Fix | Delete
apiFetch.createRootURLMiddleware = root_url;
[759] Fix | Delete
apiFetch.fetchAllMiddleware = fetch_all_middleware;
[760] Fix | Delete
apiFetch.mediaUploadMiddleware = media_upload;
[761] Fix | Delete
apiFetch.createThemePreviewMiddleware = theme_preview;
[762] Fix | Delete
/* harmony default export */ const build_module = (apiFetch);
[763] Fix | Delete
[764] Fix | Delete
(window.wp = window.wp || {}).apiFetch = __webpack_exports__["default"];
[765] Fix | Delete
/******/ })()
[766] Fix | Delete
;
[767] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function