You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在自定义Gutenberg区块中通过用户ID获取用户元数据

问题:在Gutenberg编辑器端通过用户ID获取用户元数据

我需要在自定义Gutenberg区块的编辑器端,获取PHP中get_user_meta( $user_id, 'meta_key', true );所返回的用户元数据。我尝试调用wp.data.select('core').getUserMeta(userId,'meta_key',true);但没有效果,这只是我的猜测,因为找不到相关文档。请问该如何实现?

更新:我已找到一个临时解决方案,若有人知晓正确实现方式,仍欢迎解答!


内容的提问来源于stack exchange,提问作者Shoelaced

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.05 04:05:15