【发布时间】:2023-03-03 05:26:21
【问题描述】:
我正在构建一个与我的 Wordpress 网站 Rest API 相关联的 Ionic 应用程序。虽然我已经弄清楚如何填充帖子和页面数据,但我很难填充用户数据。
具体来说,我正在尝试通过名为 UPME(用户配置文件变得简单)的第三方插件访问存储为 usermeta 的用户数据。它作为用户元数据存储在数据库中。
这是我设想从 API 拉入应用程序的图像。
比如user_id: 43 meta_key: 数据库内的linkedin。
谁能给我一个例子,说明我可以在我的functions.php中做什么,以便能够将每个用户与{...} meta_keys填充到API中以供外部访问?
编辑:这是我对它应该做什么的理解
我需要 Wordpress 中的一些功能,使我的 Rest-API 可以使用以下功能:
• Get list of all users
• For all users {
• If user upme_user_profile_status: ACTIVE
• Get the following usermeta: [
first_name
last_name
company_name
company_title
user_email
business_phone
facebook
twitter
linkedin
]
}
这将在 API 中公开访问。
【问题讨论】:
标签: wordpress ionic-framework api-design wordpress-rest-api