Files
wordpress-theme-aksrt/assets/admin/build/media.BHNcAGK-.js
T
kate522 a3dde3874a feat(admin): strip SPA ops menus; redirect old hashes to native WP (Phase 4)
SPA shop/forum/payment/users sections now keep configuration pages only.
Operational workbenches were removed from the sidebar and loaders; legacy
hash routes open NativeOpsRedirect into the matching WP native admin page.
Admin SPA production build refreshed accordingly.
2026-07-15 02:10:05 +08:00

2 lines
569 B
JavaScript

function c(n={}){var r;const o=(r=window.wp)==null?void 0:r.media;if(!o)throw new Error("当前后台未加载 WordPress 媒体库。");const e=o({title:n.title||"选择图片",button:{text:n.buttonText||"使用此图片"},library:{type:n.type||"image"},multiple:!1});return new Promise((i,s)=>{e.on("select",()=>{var l;const t=(l=e.state().get("selection").first())==null?void 0:l.toJSON();if(!(t!=null&&t.url)){s(new Error("未选择有效的媒体资源。"));return}i(t)}),e.on("close",()=>{e.state().get("selection").length>0||i(null)}),e.open()})}export{c as o};