WordPress/wp-includes/js/dist/hooks.min.js

2 lines
5.6 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.hooks=function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s="gEOj")}({gEOj:function(t,n,r){"use strict";r.r(n),r.d(n,"defaultHooks",(function(){return p})),r.d(n,"createHooks",(function(){return h})),r.d(n,"addAction",(function(){return v})),r.d(n,"addFilter",(function(){return m})),r.d(n,"removeAction",(function(){return A})),r.d(n,"removeFilter",(function(){return _})),r.d(n,"hasAction",(function(){return g})),r.d(n,"hasFilter",(function(){return y})),r.d(n,"removeAllActions",(function(){return b})),r.d(n,"removeAllFilters",(function(){return F})),r.d(n,"doAction",(function(){return k})),r.d(n,"applyFilters",(function(){return x})),r.d(n,"currentAction",(function(){return j})),r.d(n,"currentFilter",(function(){return O})),r.d(n,"doingAction",(function(){return I})),r.d(n,"doingFilter",(function(){return T})),r.d(n,"didAction",(function(){return w})),r.d(n,"didFilter",(function(){return P})),r.d(n,"actions",(function(){return S})),r.d(n,"filters",(function(){return z}));var e=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var o=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var i=function(t,n){return function(r,i,c){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const u=t[n];if(!o(r))return;if(!e(i))return;if("function"!=typeof c)return void console.error("The hook callback must be a function.");if("number"!=typeof s)return void console.error("If specified, the hook priority must be a number.");const l={callback:c,priority:s,namespace:i};if(u[r]){const t=u[r].handlers;let n;for(n=t.length;n>0&&!(s>=t[n-1].priority);n--);n===t.length?t[n]=l:t.splice(n,0,l),u.__current.forEach(t=>{t.name===r&&t.currentIndex>=n&&t.currentIndex++})}else u[r]={handlers:[l],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,i,c,s)}};var c=function(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,c){const s=t[n];if(!o(i))return;if(!r&&!e(c))return;if(!s[i])return 0;let u=0;if(r)u=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else{const t=s[i].handlers;for(let n=t.length-1;n>=0;n--)t[n].namespace===c&&(t.splice(n,1),u++,s.__current.forEach(t=>{t.name===i&&t.currentIndex>=n&&t.currentIndex--}))}return"hookRemoved"!==i&&t.doAction("hookRemoved",i,c),u}};var s=function(t,n){return function(r,e){const o=t[n];return void 0!==e?r in o&&o[r].handlers.some(t=>t.namespace===e):r in o}};var u=function(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(e){const o=t[n];o[e]||(o[e]={handlers:[],runs:0}),o[e].runs++;const i=o[e].handlers;for(var c=arguments.length,s=new Array(c>1?c-1:0),u=1;u<c;u++)s[u-1]=arguments[u];if(!i||!i.length)return r?s[0]:void 0;const l={name:e,currentIndex:0};for(o.__current.push(