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/wp-inclu.../js/dist
File: hooks.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
actions: () => (/* binding */ actions),
[41] Fix | Delete
addAction: () => (/* binding */ addAction),
[42] Fix | Delete
addFilter: () => (/* binding */ addFilter),
[43] Fix | Delete
applyFilters: () => (/* binding */ applyFilters),
[44] Fix | Delete
createHooks: () => (/* reexport */ build_module_createHooks),
[45] Fix | Delete
currentAction: () => (/* binding */ currentAction),
[46] Fix | Delete
currentFilter: () => (/* binding */ currentFilter),
[47] Fix | Delete
defaultHooks: () => (/* binding */ defaultHooks),
[48] Fix | Delete
didAction: () => (/* binding */ didAction),
[49] Fix | Delete
didFilter: () => (/* binding */ didFilter),
[50] Fix | Delete
doAction: () => (/* binding */ doAction),
[51] Fix | Delete
doingAction: () => (/* binding */ doingAction),
[52] Fix | Delete
doingFilter: () => (/* binding */ doingFilter),
[53] Fix | Delete
filters: () => (/* binding */ filters),
[54] Fix | Delete
hasAction: () => (/* binding */ hasAction),
[55] Fix | Delete
hasFilter: () => (/* binding */ hasFilter),
[56] Fix | Delete
removeAction: () => (/* binding */ removeAction),
[57] Fix | Delete
removeAllActions: () => (/* binding */ removeAllActions),
[58] Fix | Delete
removeAllFilters: () => (/* binding */ removeAllFilters),
[59] Fix | Delete
removeFilter: () => (/* binding */ removeFilter)
[60] Fix | Delete
});
[61] Fix | Delete
[62] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateNamespace.js
[63] Fix | Delete
/**
[64] Fix | Delete
* Validate a namespace string.
[65] Fix | Delete
*
[66] Fix | Delete
* @param {string} namespace The namespace to validate - should take the form
[67] Fix | Delete
* `vendor/plugin/function`.
[68] Fix | Delete
*
[69] Fix | Delete
* @return {boolean} Whether the namespace is valid.
[70] Fix | Delete
*/
[71] Fix | Delete
function validateNamespace(namespace) {
[72] Fix | Delete
if ('string' !== typeof namespace || '' === namespace) {
[73] Fix | Delete
// eslint-disable-next-line no-console
[74] Fix | Delete
console.error('The namespace must be a non-empty string.');
[75] Fix | Delete
return false;
[76] Fix | Delete
}
[77] Fix | Delete
if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
[78] Fix | Delete
// eslint-disable-next-line no-console
[79] Fix | Delete
console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');
[80] Fix | Delete
return false;
[81] Fix | Delete
}
[82] Fix | Delete
return true;
[83] Fix | Delete
}
[84] Fix | Delete
/* harmony default export */ const build_module_validateNamespace = (validateNamespace);
[85] Fix | Delete
[86] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateHookName.js
[87] Fix | Delete
/**
[88] Fix | Delete
* Validate a hookName string.
[89] Fix | Delete
*
[90] Fix | Delete
* @param {string} hookName The hook name to validate. Should be a non empty string containing
[91] Fix | Delete
* only numbers, letters, dashes, periods and underscores. Also,
[92] Fix | Delete
* the hook name cannot begin with `__`.
[93] Fix | Delete
*
[94] Fix | Delete
* @return {boolean} Whether the hook name is valid.
[95] Fix | Delete
*/
[96] Fix | Delete
function validateHookName(hookName) {
[97] Fix | Delete
if ('string' !== typeof hookName || '' === hookName) {
[98] Fix | Delete
// eslint-disable-next-line no-console
[99] Fix | Delete
console.error('The hook name must be a non-empty string.');
[100] Fix | Delete
return false;
[101] Fix | Delete
}
[102] Fix | Delete
if (/^__/.test(hookName)) {
[103] Fix | Delete
// eslint-disable-next-line no-console
[104] Fix | Delete
console.error('The hook name cannot begin with `__`.');
[105] Fix | Delete
return false;
[106] Fix | Delete
}
[107] Fix | Delete
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
[108] Fix | Delete
// eslint-disable-next-line no-console
[109] Fix | Delete
console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.');
[110] Fix | Delete
return false;
[111] Fix | Delete
}
[112] Fix | Delete
return true;
[113] Fix | Delete
}
[114] Fix | Delete
/* harmony default export */ const build_module_validateHookName = (validateHookName);
[115] Fix | Delete
[116] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createAddHook.js
[117] Fix | Delete
/**
[118] Fix | Delete
* Internal dependencies
[119] Fix | Delete
*/
[120] Fix | Delete
[121] Fix | Delete
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* @callback AddHook
[125] Fix | Delete
*
[126] Fix | Delete
* Adds the hook to the appropriate hooks container.
[127] Fix | Delete
*
[128] Fix | Delete
* @param {string} hookName Name of hook to add
[129] Fix | Delete
* @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
[130] Fix | Delete
* @param {import('.').Callback} callback Function to call when the hook is run
[131] Fix | Delete
* @param {number} [priority=10] Priority of this hook
[132] Fix | Delete
*/
[133] Fix | Delete
[134] Fix | Delete
/**
[135] Fix | Delete
* Returns a function which, when invoked, will add a hook.
[136] Fix | Delete
*
[137] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[138] Fix | Delete
* @param {import('.').StoreKey} storeKey
[139] Fix | Delete
*
[140] Fix | Delete
* @return {AddHook} Function that adds a new hook.
[141] Fix | Delete
*/
[142] Fix | Delete
function createAddHook(hooks, storeKey) {
[143] Fix | Delete
return function addHook(hookName, namespace, callback, priority = 10) {
[144] Fix | Delete
const hooksStore = hooks[storeKey];
[145] Fix | Delete
if (!build_module_validateHookName(hookName)) {
[146] Fix | Delete
return;
[147] Fix | Delete
}
[148] Fix | Delete
if (!build_module_validateNamespace(namespace)) {
[149] Fix | Delete
return;
[150] Fix | Delete
}
[151] Fix | Delete
if ('function' !== typeof callback) {
[152] Fix | Delete
// eslint-disable-next-line no-console
[153] Fix | Delete
console.error('The hook callback must be a function.');
[154] Fix | Delete
return;
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
// Validate numeric priority
[158] Fix | Delete
if ('number' !== typeof priority) {
[159] Fix | Delete
// eslint-disable-next-line no-console
[160] Fix | Delete
console.error('If specified, the hook priority must be a number.');
[161] Fix | Delete
return;
[162] Fix | Delete
}
[163] Fix | Delete
const handler = {
[164] Fix | Delete
callback,
[165] Fix | Delete
priority,
[166] Fix | Delete
namespace
[167] Fix | Delete
};
[168] Fix | Delete
if (hooksStore[hookName]) {
[169] Fix | Delete
// Find the correct insert index of the new hook.
[170] Fix | Delete
const handlers = hooksStore[hookName].handlers;
[171] Fix | Delete
[172] Fix | Delete
/** @type {number} */
[173] Fix | Delete
let i;
[174] Fix | Delete
for (i = handlers.length; i > 0; i--) {
[175] Fix | Delete
if (priority >= handlers[i - 1].priority) {
[176] Fix | Delete
break;
[177] Fix | Delete
}
[178] Fix | Delete
}
[179] Fix | Delete
if (i === handlers.length) {
[180] Fix | Delete
// If append, operate via direct assignment.
[181] Fix | Delete
handlers[i] = handler;
[182] Fix | Delete
} else {
[183] Fix | Delete
// Otherwise, insert before index via splice.
[184] Fix | Delete
handlers.splice(i, 0, handler);
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
// We may also be currently executing this hook. If the callback
[188] Fix | Delete
// we're adding would come after the current callback, there's no
[189] Fix | Delete
// problem; otherwise we need to increase the execution index of
[190] Fix | Delete
// any other runs by 1 to account for the added element.
[191] Fix | Delete
hooksStore.__current.forEach(hookInfo => {
[192] Fix | Delete
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
[193] Fix | Delete
hookInfo.currentIndex++;
[194] Fix | Delete
}
[195] Fix | Delete
});
[196] Fix | Delete
} else {
[197] Fix | Delete
// This is the first hook of its type.
[198] Fix | Delete
hooksStore[hookName] = {
[199] Fix | Delete
handlers: [handler],
[200] Fix | Delete
runs: 0
[201] Fix | Delete
};
[202] Fix | Delete
}
[203] Fix | Delete
if (hookName !== 'hookAdded') {
[204] Fix | Delete
hooks.doAction('hookAdded', hookName, namespace, callback, priority);
[205] Fix | Delete
}
[206] Fix | Delete
};
[207] Fix | Delete
}
[208] Fix | Delete
/* harmony default export */ const build_module_createAddHook = (createAddHook);
[209] Fix | Delete
[210] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js
[211] Fix | Delete
/**
[212] Fix | Delete
* Internal dependencies
[213] Fix | Delete
*/
[214] Fix | Delete
[215] Fix | Delete
[216] Fix | Delete
[217] Fix | Delete
/**
[218] Fix | Delete
* @callback RemoveHook
[219] Fix | Delete
* Removes the specified callback (or all callbacks) from the hook with a given hookName
[220] Fix | Delete
* and namespace.
[221] Fix | Delete
*
[222] Fix | Delete
* @param {string} hookName The name of the hook to modify.
[223] Fix | Delete
* @param {string} namespace The unique namespace identifying the callback in the
[224] Fix | Delete
* form `vendor/plugin/function`.
[225] Fix | Delete
*
[226] Fix | Delete
* @return {number | undefined} The number of callbacks removed.
[227] Fix | Delete
*/
[228] Fix | Delete
[229] Fix | Delete
/**
[230] Fix | Delete
* Returns a function which, when invoked, will remove a specified hook or all
[231] Fix | Delete
* hooks by the given name.
[232] Fix | Delete
*
[233] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[234] Fix | Delete
* @param {import('.').StoreKey} storeKey
[235] Fix | Delete
* @param {boolean} [removeAll=false] Whether to remove all callbacks for a hookName,
[236] Fix | Delete
* without regard to namespace. Used to create
[237] Fix | Delete
* `removeAll*` functions.
[238] Fix | Delete
*
[239] Fix | Delete
* @return {RemoveHook} Function that removes hooks.
[240] Fix | Delete
*/
[241] Fix | Delete
function createRemoveHook(hooks, storeKey, removeAll = false) {
[242] Fix | Delete
return function removeHook(hookName, namespace) {
[243] Fix | Delete
const hooksStore = hooks[storeKey];
[244] Fix | Delete
if (!build_module_validateHookName(hookName)) {
[245] Fix | Delete
return;
[246] Fix | Delete
}
[247] Fix | Delete
if (!removeAll && !build_module_validateNamespace(namespace)) {
[248] Fix | Delete
return;
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
// Bail if no hooks exist by this name.
[252] Fix | Delete
if (!hooksStore[hookName]) {
[253] Fix | Delete
return 0;
[254] Fix | Delete
}
[255] Fix | Delete
let handlersRemoved = 0;
[256] Fix | Delete
if (removeAll) {
[257] Fix | Delete
handlersRemoved = hooksStore[hookName].handlers.length;
[258] Fix | Delete
hooksStore[hookName] = {
[259] Fix | Delete
runs: hooksStore[hookName].runs,
[260] Fix | Delete
handlers: []
[261] Fix | Delete
};
[262] Fix | Delete
} else {
[263] Fix | Delete
// Try to find the specified callback to remove.
[264] Fix | Delete
const handlers = hooksStore[hookName].handlers;
[265] Fix | Delete
for (let i = handlers.length - 1; i >= 0; i--) {
[266] Fix | Delete
if (handlers[i].namespace === namespace) {
[267] Fix | Delete
handlers.splice(i, 1);
[268] Fix | Delete
handlersRemoved++;
[269] Fix | Delete
// This callback may also be part of a hook that is
[270] Fix | Delete
// currently executing. If the callback we're removing
[271] Fix | Delete
// comes after the current callback, there's no problem;
[272] Fix | Delete
// otherwise we need to decrease the execution index of any
[273] Fix | Delete
// other runs by 1 to account for the removed element.
[274] Fix | Delete
hooksStore.__current.forEach(hookInfo => {
[275] Fix | Delete
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
[276] Fix | Delete
hookInfo.currentIndex--;
[277] Fix | Delete
}
[278] Fix | Delete
});
[279] Fix | Delete
}
[280] Fix | Delete
}
[281] Fix | Delete
}
[282] Fix | Delete
if (hookName !== 'hookRemoved') {
[283] Fix | Delete
hooks.doAction('hookRemoved', hookName, namespace);
[284] Fix | Delete
}
[285] Fix | Delete
return handlersRemoved;
[286] Fix | Delete
};
[287] Fix | Delete
}
[288] Fix | Delete
/* harmony default export */ const build_module_createRemoveHook = (createRemoveHook);
[289] Fix | Delete
[290] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHasHook.js
[291] Fix | Delete
/**
[292] Fix | Delete
* @callback HasHook
[293] Fix | Delete
*
[294] Fix | Delete
* Returns whether any handlers are attached for the given hookName and optional namespace.
[295] Fix | Delete
*
[296] Fix | Delete
* @param {string} hookName The name of the hook to check for.
[297] Fix | Delete
* @param {string} [namespace] Optional. The unique namespace identifying the callback
[298] Fix | Delete
* in the form `vendor/plugin/function`.
[299] Fix | Delete
*
[300] Fix | Delete
* @return {boolean} Whether there are handlers that are attached to the given hook.
[301] Fix | Delete
*/
[302] Fix | Delete
/**
[303] Fix | Delete
* Returns a function which, when invoked, will return whether any handlers are
[304] Fix | Delete
* attached to a particular hook.
[305] Fix | Delete
*
[306] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[307] Fix | Delete
* @param {import('.').StoreKey} storeKey
[308] Fix | Delete
*
[309] Fix | Delete
* @return {HasHook} Function that returns whether any handlers are
[310] Fix | Delete
* attached to a particular hook and optional namespace.
[311] Fix | Delete
*/
[312] Fix | Delete
function createHasHook(hooks, storeKey) {
[313] Fix | Delete
return function hasHook(hookName, namespace) {
[314] Fix | Delete
const hooksStore = hooks[storeKey];
[315] Fix | Delete
[316] Fix | Delete
// Use the namespace if provided.
[317] Fix | Delete
if ('undefined' !== typeof namespace) {
[318] Fix | Delete
return hookName in hooksStore && hooksStore[hookName].handlers.some(hook => hook.namespace === namespace);
[319] Fix | Delete
}
[320] Fix | Delete
return hookName in hooksStore;
[321] Fix | Delete
};
[322] Fix | Delete
}
[323] Fix | Delete
/* harmony default export */ const build_module_createHasHook = (createHasHook);
[324] Fix | Delete
[325] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRunHook.js
[326] Fix | Delete
/**
[327] Fix | Delete
* Returns a function which, when invoked, will execute all callbacks
[328] Fix | Delete
* registered to a hook of the specified type, optionally returning the final
[329] Fix | Delete
* value of the call chain.
[330] Fix | Delete
*
[331] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[332] Fix | Delete
* @param {import('.').StoreKey} storeKey
[333] Fix | Delete
* @param {boolean} [returnFirstArg=false] Whether each hook callback is expected to
[334] Fix | Delete
* return its first argument.
[335] Fix | Delete
*
[336] Fix | Delete
* @return {(hookName:string, ...args: unknown[]) => undefined|unknown} Function that runs hook callbacks.
[337] Fix | Delete
*/
[338] Fix | Delete
function createRunHook(hooks, storeKey, returnFirstArg = false) {
[339] Fix | Delete
return function runHooks(hookName, ...args) {
[340] Fix | Delete
const hooksStore = hooks[storeKey];
[341] Fix | Delete
if (!hooksStore[hookName]) {
[342] Fix | Delete
hooksStore[hookName] = {
[343] Fix | Delete
handlers: [],
[344] Fix | Delete
runs: 0
[345] Fix | Delete
};
[346] Fix | Delete
}
[347] Fix | Delete
hooksStore[hookName].runs++;
[348] Fix | Delete
const handlers = hooksStore[hookName].handlers;
[349] Fix | Delete
[350] Fix | Delete
// The following code is stripped from production builds.
[351] Fix | Delete
if (false) {}
[352] Fix | Delete
if (!handlers || !handlers.length) {
[353] Fix | Delete
return returnFirstArg ? args[0] : undefined;
[354] Fix | Delete
}
[355] Fix | Delete
const hookInfo = {
[356] Fix | Delete
name: hookName,
[357] Fix | Delete
currentIndex: 0
[358] Fix | Delete
};
[359] Fix | Delete
hooksStore.__current.push(hookInfo);
[360] Fix | Delete
while (hookInfo.currentIndex < handlers.length) {
[361] Fix | Delete
const handler = handlers[hookInfo.currentIndex];
[362] Fix | Delete
const result = handler.callback.apply(null, args);
[363] Fix | Delete
if (returnFirstArg) {
[364] Fix | Delete
args[0] = result;
[365] Fix | Delete
}
[366] Fix | Delete
hookInfo.currentIndex++;
[367] Fix | Delete
}
[368] Fix | Delete
hooksStore.__current.pop();
[369] Fix | Delete
if (returnFirstArg) {
[370] Fix | Delete
return args[0];
[371] Fix | Delete
}
[372] Fix | Delete
return undefined;
[373] Fix | Delete
};
[374] Fix | Delete
}
[375] Fix | Delete
/* harmony default export */ const build_module_createRunHook = (createRunHook);
[376] Fix | Delete
[377] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js
[378] Fix | Delete
/**
[379] Fix | Delete
* Returns a function which, when invoked, will return the name of the
[380] Fix | Delete
* currently running hook, or `null` if no hook of the given type is currently
[381] Fix | Delete
* running.
[382] Fix | Delete
*
[383] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[384] Fix | Delete
* @param {import('.').StoreKey} storeKey
[385] Fix | Delete
*
[386] Fix | Delete
* @return {() => string | null} Function that returns the current hook name or null.
[387] Fix | Delete
*/
[388] Fix | Delete
function createCurrentHook(hooks, storeKey) {
[389] Fix | Delete
return function currentHook() {
[390] Fix | Delete
var _hooksStore$__current;
[391] Fix | Delete
const hooksStore = hooks[storeKey];
[392] Fix | Delete
return (_hooksStore$__current = hooksStore.__current[hooksStore.__current.length - 1]?.name) !== null && _hooksStore$__current !== void 0 ? _hooksStore$__current : null;
[393] Fix | Delete
};
[394] Fix | Delete
}
[395] Fix | Delete
/* harmony default export */ const build_module_createCurrentHook = (createCurrentHook);
[396] Fix | Delete
[397] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDoingHook.js
[398] Fix | Delete
/**
[399] Fix | Delete
* @callback DoingHook
[400] Fix | Delete
* Returns whether a hook is currently being executed.
[401] Fix | Delete
*
[402] Fix | Delete
* @param {string} [hookName] The name of the hook to check for. If
[403] Fix | Delete
* omitted, will check for any hook being executed.
[404] Fix | Delete
*
[405] Fix | Delete
* @return {boolean} Whether the hook is being executed.
[406] Fix | Delete
*/
[407] Fix | Delete
[408] Fix | Delete
/**
[409] Fix | Delete
* Returns a function which, when invoked, will return whether a hook is
[410] Fix | Delete
* currently being executed.
[411] Fix | Delete
*
[412] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[413] Fix | Delete
* @param {import('.').StoreKey} storeKey
[414] Fix | Delete
*
[415] Fix | Delete
* @return {DoingHook} Function that returns whether a hook is currently
[416] Fix | Delete
* being executed.
[417] Fix | Delete
*/
[418] Fix | Delete
function createDoingHook(hooks, storeKey) {
[419] Fix | Delete
return function doingHook(hookName) {
[420] Fix | Delete
const hooksStore = hooks[storeKey];
[421] Fix | Delete
[422] Fix | Delete
// If the hookName was not passed, check for any current hook.
[423] Fix | Delete
if ('undefined' === typeof hookName) {
[424] Fix | Delete
return 'undefined' !== typeof hooksStore.__current[0];
[425] Fix | Delete
}
[426] Fix | Delete
[427] Fix | Delete
// Return the __current hook.
[428] Fix | Delete
return hooksStore.__current[0] ? hookName === hooksStore.__current[0].name : false;
[429] Fix | Delete
};
[430] Fix | Delete
}
[431] Fix | Delete
/* harmony default export */ const build_module_createDoingHook = (createDoingHook);
[432] Fix | Delete
[433] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDidHook.js
[434] Fix | Delete
/**
[435] Fix | Delete
* Internal dependencies
[436] Fix | Delete
*/
[437] Fix | Delete
[438] Fix | Delete
[439] Fix | Delete
/**
[440] Fix | Delete
* @callback DidHook
[441] Fix | Delete
*
[442] Fix | Delete
* Returns the number of times an action has been fired.
[443] Fix | Delete
*
[444] Fix | Delete
* @param {string} hookName The hook name to check.
[445] Fix | Delete
*
[446] Fix | Delete
* @return {number | undefined} The number of times the hook has run.
[447] Fix | Delete
*/
[448] Fix | Delete
[449] Fix | Delete
/**
[450] Fix | Delete
* Returns a function which, when invoked, will return the number of times a
[451] Fix | Delete
* hook has been called.
[452] Fix | Delete
*
[453] Fix | Delete
* @param {import('.').Hooks} hooks Hooks instance.
[454] Fix | Delete
* @param {import('.').StoreKey} storeKey
[455] Fix | Delete
*
[456] Fix | Delete
* @return {DidHook} Function that returns a hook's call count.
[457] Fix | Delete
*/
[458] Fix | Delete
function createDidHook(hooks, storeKey) {
[459] Fix | Delete
return function didHook(hookName) {
[460] Fix | Delete
const hooksStore = hooks[storeKey];
[461] Fix | Delete
if (!build_module_validateHookName(hookName)) {
[462] Fix | Delete
return;
[463] Fix | Delete
}
[464] Fix | Delete
return hooksStore[hookName] && hooksStore[hookName].runs ? hooksStore[hookName].runs : 0;
[465] Fix | Delete
};
[466] Fix | Delete
}
[467] Fix | Delete
/* harmony default export */ const build_module_createDidHook = (createDidHook);
[468] Fix | Delete
[469] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHooks.js
[470] Fix | Delete
/**
[471] Fix | Delete
* Internal dependencies
[472] Fix | Delete
*/
[473] Fix | Delete
[474] Fix | Delete
[475] Fix | Delete
[476] Fix | Delete
[477] Fix | Delete
[478] Fix | Delete
[479] Fix | Delete
[480] Fix | Delete
[481] Fix | Delete
/**
[482] Fix | Delete
* Internal class for constructing hooks. Use `createHooks()` function
[483] Fix | Delete
*
[484] Fix | Delete
* Note, it is necessary to expose this class to make its type public.
[485] Fix | Delete
*
[486] Fix | Delete
* @private
[487] Fix | Delete
*/
[488] Fix | Delete
class _Hooks {
[489] Fix | Delete
constructor() {
[490] Fix | Delete
/** @type {import('.').Store} actions */
[491] Fix | Delete
this.actions = Object.create(null);
[492] Fix | Delete
this.actions.__current = [];
[493] Fix | Delete
[494] Fix | Delete
/** @type {import('.').Store} filters */
[495] Fix | Delete
this.filters = Object.create(null);
[496] Fix | Delete
this.filters.__current = [];
[497] Fix | Delete
this.addAction = build_module_createAddHook(this, 'actions');
[498] Fix | Delete
this.addFilter = build_module_createAddHook(this, 'filters');
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function