跳到内容

Require Auth Users REST Endpoint

v1.0.0

Sal Ferrarello · 2024年7月30日 上架

Require authentication when accessing the /wp-json/wp/v2/users REST API endpoint.

正在使用
40+
评分
暂无
累计下载
1,585
最近更新
2026年1月13日
需要 WordPress 6.5+已测试到 6.9.12PHP 7.2+

贡献者

This plugin modifies the /wp-json/wp/v2/users endpoint to require authentication.

By default on a WordPress site you can list the users that have posted content on the site by visiting this endpoint.

This plugin requires the user to be authenticated to view the list of users.

What this means

If you go directly to the URL /wp-json/wp/v2/users you will get a 401 Unauthorized response.

But if you open a block editor page and run the following from the browser console,

await wp.apiFetch({path: 'wp/v2/users'});

you will get a list of users (because the wp.apiFetch() function authenticates the user’s call to the WordPress REST API).

Author

Sal Ferrarello / salferrarello.com

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums