| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 var wp;(wp||={}).coreCommands=(()=>{var Za=Object.create;var B=Object.defineProperty;var $a=Object.getOwnPropertyDescriptor;var Wa=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Qa=Object.prototype.hasOwnProperty;var n=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),Xa=(a,t)=>{for(var o in t)B(a,o,{get:t[o],enumerable:!0})},ca=(a,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of Wa(t))!Qa.call(a,f)&&f!==o&&B(a,f,{get:()=>t[f],enumerable:!(r=$a(t,f))||r.enumerable});return a};var e=(a,t,o)=>(o=a!=null?Za(Ja(a)):{},ca(t||!a||!a.__esModule?B(o,"default",{value:a,enumerable:!0}):o,a)),Ka=a=>ca(B({},"__esModule",{value:!0}),a);var R=n((dt,ha)=>{ha.exports=window.wp.element});var Z=n((it,ga)=>{ga.exports=window.wp.router});var V=n((ut,wa)=>{wa.exports=window.wp.commands});var $=n((pt,va)=>{va.exports=window.wp.i18n});var g=n((nt,ba)=>{ba.exports=window.wp.primitives});var h=n((ct,ya)=>{ya.exports=window.ReactJSXRuntime});var da=n((At,xa)=>{xa.exports=window.wp.coreData});var ia=n((Mt,Ca)=>{Ca.exports=window.wp.data});var _a=n((Gt,Sa)=>{Sa.exports=window.wp.url});var Ra=n((Ut,Ba)=>{Ba.exports=window.wp.compose});var Pa=n((Ht,Va)=>{Va.exports=window.wp.htmlEntities});var Ea=n((Nt,Ta)=>{Ta.exports=window.wp.privateApis});var lt={};Xa(lt,{initializeCommandPalette:()=>ft,privateApis:()=>pa});var q=e(R()),Fa=e(Z()),Ia=e(V());var H=e(V()),S=e($());var P=e(g()),W=e(h()),J=(0,W.jsx)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,W.jsx)(P.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})});var T=e(g()),Q=e(h()),X=(0,Q.jsx)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Q.jsx)(T.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var E=e(g()),K=e(h()),z=(0,K.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,K.jsx)(E.Path,{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"})});var A=e(g()),Y=e(h()),aa=(0,Y.jsx)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Y.jsx)(A.Path,{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"})});var L=e(g()),k=e(h()),ta=(0,k.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,k.jsx)(L.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,k.jsx)(L.Path,{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"})]});var M=e(g()),ea=e(h()),oa=(0,ea.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ea.jsx)(M.Path,{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"})});var j=e(g()),ra=e(h()),sa=(0,ra.jsx)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,ra.jsx)(j.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})});var D=e(g()),fa=e(h()),G=(0,fa.jsx)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fa.jsx)(D.Path,{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"})});var U=e(g()),la=e(h()),ma=(0,la.jsx)(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,la.jsx)(U.Path,{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"})});var ua=e(R()),La=e(da()),ka=e(ia()),Ya=()=>function(){let t=(0,ka.useSelect)(r=>r(La.store).getEntityRecord("root","__unstableBase")?.home,[]);return{isLoading:!1,commands:(0,ua.useMemo)(()=>t?[{name:"core/view-site",label:(0,S.__)("View site"),icon:X,callback:({close:r})=>{r(),window.open(t,"_blank")}}]:[],[t])}};function N(a){let t=(0,ua.useMemo)(()=>(a??[]).map(o=>{let r=(0,S.sprintf)((0,S.__)("Go to: %s"),o.label);return{name:o.name,label:r,searchLabel:r,callback:({close:f})=>{document.location=o.url,f()}}}),[a]);(0,H.useCommands)(t),(0,H.useCommandLoader)({name:"core/view-site",hook:Ya()})}var y=e(V()),b=e($()),w=e(R()),x=e(ia()),p=e(da());var Ga=e(Z()),i=e(_a()),Ua=e(Ra()),Ha=e(Pa());var za=e(Ea()),{lock:Aa,unlock:F}=(0,za.__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");function Ma(a=[],t=""){if(!Array.isArray(a)||!a.length)return[];if(!t)return a;let o=[],r=[];for(let f=0;f<a.length;f++){let l=a[f];l?.title?.raw?.toLowerCase()?.includes(t?.toLowerCase())?o.push(l):r.push(l)}return o.concat(r)}var{useHistory:I}=F(Ga.privateApis),Na={post:oa,page:ta,wp_template:z,wp_template_part:G};function at(a){let[t,o]=(0,w.useState)(""),r=(0,Ua.useDebounce)(o,250);return(0,w.useEffect)(()=>(r(a),()=>r.cancel()),[r,a]),t}var ja=a=>function({search:o}){let r=I(),{isBlockBasedTheme:f,canCreateTemplate:l}=(0,x.useSelect)(s=>({isBlockBasedTheme:s(p.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:s(p.store).canUser("create",{kind:"postType",name:"wp_template"})}),[]),v=at(o),{records:m,isLoading:d}=(0,x.useSelect)(s=>{if(!v)return{isLoading:!1};let c={search:v,per_page:10,orderby:"relevance",status:["publish","future","draft","pending","private"]};return{records:s(p.store).getEntityRecords("postType",a,c),isLoading:!s(p.store).hasFinishedResolution("getEntityRecords",["postType",a,c])}},[v]);return{commands:(0,w.useMemo)(()=>(m??[]).map(s=>{let c={name:a+"-"+s.id,searchLabel:s.title?.rendered+" "+s.id,label:s.title?.rendered?(0,Ha.decodeEntities)(s.title?.rendered):(0,b.__)("(no title)"),icon:Na[a]};if(!l||a==="post"||a==="page"&&!f)return{...c,callback:({close:C})=>{let Oa={post:s.id,action:"edit"},qa=(0,i.addQueryArgs)("post.php",Oa);document.location=qa,C()}};let u=(0,i.getPath)(window.location.href)?.includes("site-editor.php");return{...c,callback:({close:C})=>{u?r.navigate(`/$a}/$s.id}?canvas=edit`):document.location=(0,i.addQueryArgs)("site-editor.php",{p:`/$a}/$s.id}`,canvas:"edit"}),C()}}}),[l,m,f,r]),isLoading:d}},Da=a=>function({search:o}){let r=I(),{isBlockBasedTheme:f,canCreateTemplate:l}=(0,x.useSelect)(s=>({isBlockBasedTheme:s(p.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:s(p.store).canUser("create",{kind:"postType",name:a})}),[]),{records:v,isLoading:m}=(0,x.useSelect)(s=>{let{getEntityRecords:c}=s(p.store),u={per_page:-1};return{records:c("postType",a,u),isLoading:!s(p.store).hasFinishedResolution("getEntityRecords",["postType",a,u])}},[]),d=(0,w.useMemo)(()=>Ma(v,o).slice(0,10),[v,o]);return{commands:(0,w.useMemo)(()=>{if(!l||!f&&!a==="wp_template_part")return[];let s=(0,i.getPath)(window.location.href)?.includes("site-editor.php"),c=[];return c.push(...d.map(u=>({name:a+"-"+u.id,searchLabel:u.title?.rendered+" "+u.id,label:u.title?.rendered?u.title?.rendered:(0,b.__)("(no title)"),icon:Na[a],callback:({close:C})=>{s?r.navigate(`/$a}/$u.id}?canvas=edit`):document.location=(0,i.addQueryArgs)("site-editor.php",{p:`/$a}/$u.id}`,canvas:"edit"}),C()}}))),d?.length>0&&a==="wp_template_part"&&c.push({name:"core/edit-site/open-template-parts",label:(0,b.__)("Go to: Template parts"),icon:G,callback:({close:u})=>{s?r.navigate("/pattern?postType=wp_template_part&categoryId=all-parts"):document.location=(0,i.addQueryArgs)("site-editor.php",{p:"/pattern",postType:"wp_template_part",categoryId:"all-parts"}),u()}}),c},[l,f,d,r]),isLoading:m}},tt=()=>function(){let t=I(),o=(0,i.getPath)(window.location.href)?.includes("site-editor.php"),{isBlockBasedTheme:r,canCreateTemplate:f,canCreatePatterns:l}=(0,x.useSelect)(m=>({isBlockBasedTheme:m(p.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:m(p.store).canUser("create",{kind:"postType",name:"wp_template"}),canCreatePatterns:m(p.store).canUser("create",{kind:"postType",name:"wp_block"})}),[]);return{commands:(0,w.useMemo)(()=>{let m=[];return f&&r&&(m.push({name:"core/edit-site/open-styles",label:(0,b.__)("Go to: Styles"),icon:sa,callback:({close:d})=>{o?t.navigate("/styles"):document.location=(0,i.addQueryArgs)("site-editor.php",{p:"/styles"}),d()}}),m.push({name:"core/edit-site/open-navigation",label:(0,b.__)("Go to: Navigation"),icon:aa,callback:({close:d})=>{o?t.navigate("/navigation"):document.location=(0,i.addQueryArgs)("site-editor.php",{p:"/navigation"}),d()}}),m.push({name:"core/edit-site/open-templates",label:(0,b.__)("Go to: Templates"),icon:z,callback:({close:d})=>{o?t.navigate("/template"):document.location=(0,i.addQueryArgs)("site-editor.php",{p:"/template"}),d()}})),l&&m.push({name:"core/edit-site/open-patterns",label:(0,b.__)("Go to: Patterns"),icon:ma,callback:({close:d})=>{f?(o?t.navigate("/pattern"):document.location=(0,i.addQueryArgs)("site-editor.php",{p:"/pattern"}),d()):document.location.href="edit.php?post_type=wp_block"}}),m},[t,o,f,l,r]),isLoading:!1}},et=()=>function(){let t=I(),o=(0,i.getPath)(window.location.href)?.includes("site-editor.php"),{canEditCSS:r}=(0,x.useSelect)(l=>{let{getEntityRecord:v,__experimentalGetCurrentGlobalStylesId:m}=l(p.store),d=m();return{canEditCSS:!!(d?v("root","globalStyles",d):void 0)?._links?.["wp:action-edit-css"]}},[]);return{isLoading:!1,commands:(0,w.useMemo)(()=>r?[{name:"core/open-styles-css",label:(0,b.__)("Open custom CSS"),icon:J,callback:({close:l})=>{l(),o?t.navigate("/styles?section=/css"):document.location=(0,i.addQueryArgs)("site-editor.php",{p:"/styles",section:"/css"})}}]:[],[t,r,o])}};function O(a){(0,y.useCommandLoader)({name:"core/edit-site/navigate-pages",hook:ja("page"),disabled:a}),(0,y.useCommandLoader)({name:"core/edit-site/navigate-posts",hook:ja("post"),disabled:a}),(0,y.useCommandLoader)({name:"core/edit-site/navigate-templates",hook:Da("wp_template"),disabled:a}),(0,y.useCommandLoader)({name:"core/edit-site/navigate-template-parts",hook:Da("wp_template_part"),disabled:a}),(0,y.useCommandLoader)({name:"core/edit-site/basic-navigation",hook:tt(),context:"site-editor",disabled:a}),(0,y.useCommandLoader)({name:"core/edit-site/global-styles-css",hook:et(),disabled:a})}function ot(){N(),O()}var pa={};Aa(pa,{useCommands:ot});var _=e(h()),{RouterProvider:rt}=F(Fa.privateApis);function st({settings:a}){let{menu_commands:t,is_network_admin:o}=a;return N(t),O(o),(0,_.jsx)(rt,{pathArg:"p",children:(0,_.jsx)(Ia.CommandMenu,{})})}function ft(a){let t=document.createElement("div");document.body.appendChild(t),(0,q.createRoot)(t).render((0,_.jsx)(q.StrictMode,{children:(0,_.jsx)(st,{settings:a})}))}return Ka(lt);})();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Wed Mar 4 08:20:02 2026 | Cross-referenced by PHPXref |