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
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: core-commands.js
/******/ (() => { // webpackBootstrap
[0] Fix | Delete
/******/ "use strict";
[1] Fix | Delete
/******/ // The require scope
[2] Fix | Delete
/******/ var __webpack_require__ = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/************************************************************************/
[5] Fix | Delete
/******/ /* webpack/runtime/define property getters */
[6] Fix | Delete
/******/ (() => {
[7] Fix | Delete
/******/ // define getter functions for harmony exports
[8] Fix | Delete
/******/ __webpack_require__.d = (exports, definition) => {
[9] Fix | Delete
/******/ for(var key in definition) {
[10] Fix | Delete
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
[11] Fix | Delete
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
[12] Fix | Delete
/******/ }
[13] Fix | Delete
/******/ }
[14] Fix | Delete
/******/ };
[15] Fix | Delete
/******/ })();
[16] Fix | Delete
/******/
[17] Fix | Delete
/******/ /* webpack/runtime/hasOwnProperty shorthand */
[18] Fix | Delete
/******/ (() => {
[19] Fix | Delete
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
[20] Fix | Delete
/******/ })();
[21] Fix | Delete
/******/
[22] Fix | Delete
/******/ /* webpack/runtime/make namespace object */
[23] Fix | Delete
/******/ (() => {
[24] Fix | Delete
/******/ // define __esModule on exports
[25] Fix | Delete
/******/ __webpack_require__.r = (exports) => {
[26] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[27] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[28] Fix | Delete
/******/ }
[29] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[30] Fix | Delete
/******/ };
[31] Fix | Delete
/******/ })();
[32] Fix | Delete
/******/
[33] Fix | Delete
/************************************************************************/
[34] Fix | Delete
var __webpack_exports__ = {};
[35] Fix | Delete
// ESM COMPAT FLAG
[36] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[37] Fix | Delete
[38] Fix | Delete
// EXPORTS
[39] Fix | Delete
__webpack_require__.d(__webpack_exports__, {
[40] Fix | Delete
privateApis: () => (/* reexport */ privateApis)
[41] Fix | Delete
});
[42] Fix | Delete
[43] Fix | Delete
;// CONCATENATED MODULE: external ["wp","commands"]
[44] Fix | Delete
const external_wp_commands_namespaceObject = window["wp"]["commands"];
[45] Fix | Delete
;// CONCATENATED MODULE: external ["wp","i18n"]
[46] Fix | Delete
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
[47] Fix | Delete
;// CONCATENATED MODULE: external ["wp","primitives"]
[48] Fix | Delete
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
[49] Fix | Delete
;// CONCATENATED MODULE: external "ReactJSXRuntime"
[50] Fix | Delete
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
[51] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
[52] Fix | Delete
/**
[53] Fix | Delete
* WordPress dependencies
[54] Fix | Delete
*/
[55] Fix | Delete
[56] Fix | Delete
[57] Fix | Delete
const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[58] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[59] Fix | Delete
viewBox: "0 0 24 24",
[60] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[61] Fix | Delete
d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"
[62] Fix | Delete
})
[63] Fix | Delete
});
[64] Fix | Delete
/* harmony default export */ const library_plus = (plus);
[65] Fix | Delete
[66] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/admin-navigation-commands.js
[67] Fix | Delete
/**
[68] Fix | Delete
* WordPress dependencies
[69] Fix | Delete
*/
[70] Fix | Delete
[71] Fix | Delete
[72] Fix | Delete
[73] Fix | Delete
function useAdminNavigationCommands() {
[74] Fix | Delete
(0,external_wp_commands_namespaceObject.useCommand)({
[75] Fix | Delete
name: 'core/add-new-post',
[76] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Add new post'),
[77] Fix | Delete
icon: library_plus,
[78] Fix | Delete
callback: () => {
[79] Fix | Delete
document.location.href = 'post-new.php';
[80] Fix | Delete
}
[81] Fix | Delete
});
[82] Fix | Delete
(0,external_wp_commands_namespaceObject.useCommand)({
[83] Fix | Delete
name: 'core/add-new-page',
[84] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Add new page'),
[85] Fix | Delete
icon: library_plus,
[86] Fix | Delete
callback: () => {
[87] Fix | Delete
document.location.href = 'post-new.php?post_type=page';
[88] Fix | Delete
}
[89] Fix | Delete
});
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
;// CONCATENATED MODULE: external ["wp","element"]
[93] Fix | Delete
const external_wp_element_namespaceObject = window["wp"]["element"];
[94] Fix | Delete
;// CONCATENATED MODULE: external ["wp","data"]
[95] Fix | Delete
const external_wp_data_namespaceObject = window["wp"]["data"];
[96] Fix | Delete
;// CONCATENATED MODULE: external ["wp","coreData"]
[97] Fix | Delete
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
[98] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post.js
[99] Fix | Delete
/**
[100] Fix | Delete
* WordPress dependencies
[101] Fix | Delete
*/
[102] Fix | Delete
[103] Fix | Delete
[104] Fix | Delete
const post = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[105] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[106] Fix | Delete
viewBox: "0 0 24 24",
[107] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[108] Fix | Delete
d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"
[109] Fix | Delete
})
[110] Fix | Delete
});
[111] Fix | Delete
/* harmony default export */ const library_post = (post);
[112] Fix | Delete
[113] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
[114] Fix | Delete
/**
[115] Fix | Delete
* WordPress dependencies
[116] Fix | Delete
*/
[117] Fix | Delete
[118] Fix | Delete
[119] Fix | Delete
[120] Fix | Delete
const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
[121] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[122] Fix | Delete
viewBox: "0 0 24 24",
[123] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[124] Fix | Delete
d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
[125] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[126] Fix | Delete
d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"
[127] Fix | Delete
})]
[128] Fix | Delete
});
[129] Fix | Delete
/* harmony default export */ const library_page = (page);
[130] Fix | Delete
[131] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
[132] Fix | Delete
/**
[133] Fix | Delete
* WordPress dependencies
[134] Fix | Delete
*/
[135] Fix | Delete
[136] Fix | Delete
[137] Fix | Delete
const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[138] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[139] Fix | Delete
viewBox: "0 0 24 24",
[140] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[141] Fix | Delete
d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
[142] Fix | Delete
})
[143] Fix | Delete
});
[144] Fix | Delete
/* harmony default export */ const library_layout = (layout);
[145] Fix | Delete
[146] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
[147] Fix | Delete
/**
[148] Fix | Delete
* WordPress dependencies
[149] Fix | Delete
*/
[150] Fix | Delete
[151] Fix | Delete
[152] Fix | Delete
const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[153] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[154] Fix | Delete
viewBox: "0 0 24 24",
[155] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[156] Fix | Delete
d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
[157] Fix | Delete
})
[158] Fix | Delete
});
[159] Fix | Delete
/* harmony default export */ const symbol_filled = (symbolFilled);
[160] Fix | Delete
[161] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
[162] Fix | Delete
/**
[163] Fix | Delete
* WordPress dependencies
[164] Fix | Delete
*/
[165] Fix | Delete
[166] Fix | Delete
[167] Fix | Delete
const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[168] Fix | Delete
viewBox: "0 0 24 24",
[169] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[170] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[171] Fix | Delete
d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
[172] Fix | Delete
})
[173] Fix | Delete
});
[174] Fix | Delete
/* harmony default export */ const library_navigation = (navigation);
[175] Fix | Delete
[176] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/styles.js
[177] Fix | Delete
/**
[178] Fix | Delete
* WordPress dependencies
[179] Fix | Delete
*/
[180] Fix | Delete
[181] Fix | Delete
[182] Fix | Delete
const styles = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[183] Fix | Delete
viewBox: "0 0 24 24",
[184] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[185] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[186] Fix | Delete
d: "M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"
[187] Fix | Delete
})
[188] Fix | Delete
});
[189] Fix | Delete
/* harmony default export */ const library_styles = (styles);
[190] Fix | Delete
[191] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
[192] Fix | Delete
/**
[193] Fix | Delete
* WordPress dependencies
[194] Fix | Delete
*/
[195] Fix | Delete
[196] Fix | Delete
[197] Fix | Delete
const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[198] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[199] Fix | Delete
viewBox: "0 0 24 24",
[200] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[201] Fix | Delete
d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
[202] Fix | Delete
})
[203] Fix | Delete
});
[204] Fix | Delete
/* harmony default export */ const library_symbol = (symbol);
[205] Fix | Delete
[206] Fix | Delete
;// CONCATENATED MODULE: external ["wp","router"]
[207] Fix | Delete
const external_wp_router_namespaceObject = window["wp"]["router"];
[208] Fix | Delete
;// CONCATENATED MODULE: external ["wp","url"]
[209] Fix | Delete
const external_wp_url_namespaceObject = window["wp"]["url"];
[210] Fix | Delete
;// CONCATENATED MODULE: external ["wp","compose"]
[211] Fix | Delete
const external_wp_compose_namespaceObject = window["wp"]["compose"];
[212] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/hooks.js
[213] Fix | Delete
/**
[214] Fix | Delete
* WordPress dependencies
[215] Fix | Delete
*/
[216] Fix | Delete
[217] Fix | Delete
[218] Fix | Delete
function useIsBlockBasedTheme() {
[219] Fix | Delete
return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []);
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
;// CONCATENATED MODULE: external ["wp","privateApis"]
[223] Fix | Delete
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
[224] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/lock-unlock.js
[225] Fix | Delete
/**
[226] Fix | Delete
* WordPress dependencies
[227] Fix | Delete
*/
[228] Fix | Delete
[229] Fix | Delete
const {
[230] Fix | Delete
lock,
[231] Fix | Delete
unlock
[232] Fix | Delete
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-commands');
[233] Fix | Delete
[234] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/utils/order-entity-records-by-search.js
[235] Fix | Delete
function orderEntityRecordsBySearch(records = [], search = '') {
[236] Fix | Delete
if (!Array.isArray(records) || !records.length) {
[237] Fix | Delete
return [];
[238] Fix | Delete
}
[239] Fix | Delete
if (!search) {
[240] Fix | Delete
return records;
[241] Fix | Delete
}
[242] Fix | Delete
const priority = [];
[243] Fix | Delete
const nonPriority = [];
[244] Fix | Delete
for (let i = 0; i < records.length; i++) {
[245] Fix | Delete
const record = records[i];
[246] Fix | Delete
if (record?.title?.raw?.toLowerCase()?.includes(search?.toLowerCase())) {
[247] Fix | Delete
priority.push(record);
[248] Fix | Delete
} else {
[249] Fix | Delete
nonPriority.push(record);
[250] Fix | Delete
}
[251] Fix | Delete
}
[252] Fix | Delete
return priority.concat(nonPriority);
[253] Fix | Delete
}
[254] Fix | Delete
[255] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/site-editor-navigation-commands.js
[256] Fix | Delete
/**
[257] Fix | Delete
* WordPress dependencies
[258] Fix | Delete
*/
[259] Fix | Delete
[260] Fix | Delete
[261] Fix | Delete
[262] Fix | Delete
[263] Fix | Delete
[264] Fix | Delete
[265] Fix | Delete
[266] Fix | Delete
[267] Fix | Delete
[268] Fix | Delete
[269] Fix | Delete
/**
[270] Fix | Delete
* Internal dependencies
[271] Fix | Delete
*/
[272] Fix | Delete
[273] Fix | Delete
[274] Fix | Delete
[275] Fix | Delete
const {
[276] Fix | Delete
useHistory
[277] Fix | Delete
} = unlock(external_wp_router_namespaceObject.privateApis);
[278] Fix | Delete
const icons = {
[279] Fix | Delete
post: library_post,
[280] Fix | Delete
page: library_page,
[281] Fix | Delete
wp_template: library_layout,
[282] Fix | Delete
wp_template_part: symbol_filled
[283] Fix | Delete
};
[284] Fix | Delete
function useDebouncedValue(value) {
[285] Fix | Delete
const [debouncedValue, setDebouncedValue] = (0,external_wp_element_namespaceObject.useState)('');
[286] Fix | Delete
const debounced = (0,external_wp_compose_namespaceObject.useDebounce)(setDebouncedValue, 250);
[287] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[288] Fix | Delete
debounced(value);
[289] Fix | Delete
return () => debounced.cancel();
[290] Fix | Delete
}, [debounced, value]);
[291] Fix | Delete
return debouncedValue;
[292] Fix | Delete
}
[293] Fix | Delete
const getNavigationCommandLoaderPerPostType = postType => function useNavigationCommandLoader({
[294] Fix | Delete
search
[295] Fix | Delete
}) {
[296] Fix | Delete
const history = useHistory();
[297] Fix | Delete
const isBlockBasedTheme = useIsBlockBasedTheme();
[298] Fix | Delete
const delayedSearch = useDebouncedValue(search);
[299] Fix | Delete
const {
[300] Fix | Delete
records,
[301] Fix | Delete
isLoading
[302] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[303] Fix | Delete
if (!delayedSearch) {
[304] Fix | Delete
return {
[305] Fix | Delete
isLoading: false
[306] Fix | Delete
};
[307] Fix | Delete
}
[308] Fix | Delete
const query = {
[309] Fix | Delete
search: delayedSearch,
[310] Fix | Delete
per_page: 10,
[311] Fix | Delete
orderby: 'relevance',
[312] Fix | Delete
status: ['publish', 'future', 'draft', 'pending', 'private']
[313] Fix | Delete
};
[314] Fix | Delete
return {
[315] Fix | Delete
records: select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', postType, query),
[316] Fix | Delete
isLoading: !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getEntityRecords', ['postType', postType, query])
[317] Fix | Delete
};
[318] Fix | Delete
}, [delayedSearch]);
[319] Fix | Delete
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
[320] Fix | Delete
return (records !== null && records !== void 0 ? records : []).map(record => {
[321] Fix | Delete
const command = {
[322] Fix | Delete
name: postType + '-' + record.id,
[323] Fix | Delete
searchLabel: record.title?.rendered + ' ' + record.id,
[324] Fix | Delete
label: record.title?.rendered ? record.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'),
[325] Fix | Delete
icon: icons[postType]
[326] Fix | Delete
};
[327] Fix | Delete
if (postType === 'post' || postType === 'page' && !isBlockBasedTheme) {
[328] Fix | Delete
return {
[329] Fix | Delete
...command,
[330] Fix | Delete
callback: ({
[331] Fix | Delete
close
[332] Fix | Delete
}) => {
[333] Fix | Delete
const args = {
[334] Fix | Delete
post: record.id,
[335] Fix | Delete
action: 'edit'
[336] Fix | Delete
};
[337] Fix | Delete
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', args);
[338] Fix | Delete
document.location = targetUrl;
[339] Fix | Delete
close();
[340] Fix | Delete
}
[341] Fix | Delete
};
[342] Fix | Delete
}
[343] Fix | Delete
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
[344] Fix | Delete
return {
[345] Fix | Delete
...command,
[346] Fix | Delete
callback: ({
[347] Fix | Delete
close
[348] Fix | Delete
}) => {
[349] Fix | Delete
const args = {
[350] Fix | Delete
postType,
[351] Fix | Delete
postId: record.id,
[352] Fix | Delete
canvas: 'edit'
[353] Fix | Delete
};
[354] Fix | Delete
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
[355] Fix | Delete
if (isSiteEditor) {
[356] Fix | Delete
history.push(args);
[357] Fix | Delete
} else {
[358] Fix | Delete
document.location = targetUrl;
[359] Fix | Delete
}
[360] Fix | Delete
close();
[361] Fix | Delete
}
[362] Fix | Delete
};
[363] Fix | Delete
});
[364] Fix | Delete
}, [records, isBlockBasedTheme, history]);
[365] Fix | Delete
return {
[366] Fix | Delete
commands,
[367] Fix | Delete
isLoading
[368] Fix | Delete
};
[369] Fix | Delete
};
[370] Fix | Delete
const getNavigationCommandLoaderPerTemplate = templateType => function useNavigationCommandLoader({
[371] Fix | Delete
search
[372] Fix | Delete
}) {
[373] Fix | Delete
const history = useHistory();
[374] Fix | Delete
const isBlockBasedTheme = useIsBlockBasedTheme();
[375] Fix | Delete
const {
[376] Fix | Delete
records,
[377] Fix | Delete
isLoading
[378] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[379] Fix | Delete
const {
[380] Fix | Delete
getEntityRecords
[381] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[382] Fix | Delete
const query = {
[383] Fix | Delete
per_page: -1
[384] Fix | Delete
};
[385] Fix | Delete
return {
[386] Fix | Delete
records: getEntityRecords('postType', templateType, query),
[387] Fix | Delete
isLoading: !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getEntityRecords', ['postType', templateType, query])
[388] Fix | Delete
};
[389] Fix | Delete
}, []);
[390] Fix | Delete
[391] Fix | Delete
/*
[392] Fix | Delete
* wp_template and wp_template_part endpoints do not support per_page or orderby parameters.
[393] Fix | Delete
* We need to sort the results based on the search query to avoid removing relevant
[394] Fix | Delete
* records below using .slice().
[395] Fix | Delete
*/
[396] Fix | Delete
const orderedRecords = (0,external_wp_element_namespaceObject.useMemo)(() => {
[397] Fix | Delete
return orderEntityRecordsBySearch(records, search).slice(0, 10);
[398] Fix | Delete
}, [records, search]);
[399] Fix | Delete
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
[400] Fix | Delete
if (!isBlockBasedTheme && !templateType === 'wp_template_part') {
[401] Fix | Delete
return [];
[402] Fix | Delete
}
[403] Fix | Delete
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
[404] Fix | Delete
const result = [];
[405] Fix | Delete
result.push(...orderedRecords.map(record => {
[406] Fix | Delete
return {
[407] Fix | Delete
name: templateType + '-' + record.id,
[408] Fix | Delete
searchLabel: record.title?.rendered + ' ' + record.id,
[409] Fix | Delete
label: record.title?.rendered ? record.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'),
[410] Fix | Delete
icon: icons[templateType],
[411] Fix | Delete
callback: ({
[412] Fix | Delete
close
[413] Fix | Delete
}) => {
[414] Fix | Delete
const args = {
[415] Fix | Delete
postType: templateType,
[416] Fix | Delete
postId: record.id,
[417] Fix | Delete
canvas: 'edit'
[418] Fix | Delete
};
[419] Fix | Delete
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
[420] Fix | Delete
if (isSiteEditor) {
[421] Fix | Delete
history.push(args);
[422] Fix | Delete
} else {
[423] Fix | Delete
document.location = targetUrl;
[424] Fix | Delete
}
[425] Fix | Delete
close();
[426] Fix | Delete
}
[427] Fix | Delete
};
[428] Fix | Delete
}));
[429] Fix | Delete
if (orderedRecords?.length > 0 && templateType === 'wp_template_part') {
[430] Fix | Delete
result.push({
[431] Fix | Delete
name: 'core/edit-site/open-template-parts',
[432] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Template parts'),
[433] Fix | Delete
icon: symbol_filled,
[434] Fix | Delete
callback: ({
[435] Fix | Delete
close
[436] Fix | Delete
}) => {
[437] Fix | Delete
const args = {
[438] Fix | Delete
postType: 'wp_template_part',
[439] Fix | Delete
categoryId: 'all-parts'
[440] Fix | Delete
};
[441] Fix | Delete
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
[442] Fix | Delete
if (isSiteEditor) {
[443] Fix | Delete
history.push(args);
[444] Fix | Delete
} else {
[445] Fix | Delete
document.location = targetUrl;
[446] Fix | Delete
}
[447] Fix | Delete
close();
[448] Fix | Delete
}
[449] Fix | Delete
});
[450] Fix | Delete
}
[451] Fix | Delete
return result;
[452] Fix | Delete
}, [isBlockBasedTheme, orderedRecords, history]);
[453] Fix | Delete
return {
[454] Fix | Delete
commands,
[455] Fix | Delete
isLoading
[456] Fix | Delete
};
[457] Fix | Delete
};
[458] Fix | Delete
const usePageNavigationCommandLoader = getNavigationCommandLoaderPerPostType('page');
[459] Fix | Delete
const usePostNavigationCommandLoader = getNavigationCommandLoaderPerPostType('post');
[460] Fix | Delete
const useTemplateNavigationCommandLoader = getNavigationCommandLoaderPerTemplate('wp_template');
[461] Fix | Delete
const useTemplatePartNavigationCommandLoader = getNavigationCommandLoaderPerTemplate('wp_template_part');
[462] Fix | Delete
function useSiteEditorBasicNavigationCommands() {
[463] Fix | Delete
const history = useHistory();
[464] Fix | Delete
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
[465] Fix | Delete
const canCreateTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => {
[466] Fix | Delete
return select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates');
[467] Fix | Delete
}, []);
[468] Fix | Delete
const isBlockBasedTheme = useIsBlockBasedTheme();
[469] Fix | Delete
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
[470] Fix | Delete
const result = [];
[471] Fix | Delete
if (canCreateTemplate && isBlockBasedTheme) {
[472] Fix | Delete
result.push({
[473] Fix | Delete
name: 'core/edit-site/open-navigation',
[474] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
[475] Fix | Delete
icon: library_navigation,
[476] Fix | Delete
callback: ({
[477] Fix | Delete
close
[478] Fix | Delete
}) => {
[479] Fix | Delete
const args = {
[480] Fix | Delete
postType: 'wp_navigation'
[481] Fix | Delete
};
[482] Fix | Delete
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
[483] Fix | Delete
if (isSiteEditor) {
[484] Fix | Delete
history.push(args);
[485] Fix | Delete
} else {
[486] Fix | Delete
document.location = targetUrl;
[487] Fix | Delete
}
[488] Fix | Delete
close();
[489] Fix | Delete
}
[490] Fix | Delete
});
[491] Fix | Delete
result.push({
[492] Fix | Delete
name: 'core/edit-site/open-styles',
[493] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Styles'),
[494] Fix | Delete
icon: library_styles,
[495] Fix | Delete
callback: ({
[496] Fix | Delete
close
[497] Fix | Delete
}) => {
[498] Fix | Delete
const args = {
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function