Title: Require Auth Users REST Endpoint
Author: Sal Ferrarello
Published: <strong>2024 年 7 月 30 日</strong>
Last modified: 2026 年 1 月 13 日

---

搜索插件

![](https://ps.w.org/require-auth-users-rest-endpoint/assets/banner-772x250.png?
rev=3128061)

![](https://ps.w.org/require-auth-users-rest-endpoint/assets/icon.svg?rev=3128061)

# Require Auth Users REST Endpoint

 作者：[Sal Ferrarello](https://profiles.wordpress.org/salcode/)

[下载](https://downloads.wordpress.org/plugin/require-auth-users-rest-endpoint.1.0.0.zip)

 * [详情](https://cn.wordpress.org/plugins/require-auth-users-rest-endpoint/#description)
 * [评价](https://cn.wordpress.org/plugins/require-auth-users-rest-endpoint/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/require-auth-users-rest-endpoint/#developers)

 [支持](https://wordpress.org/support/plugin/require-auth-users-rest-endpoint/)

## 描述

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](https://salferrarello.com)

## 评价

此插件暂无评价。

## 贡献者及开发者

「Require Auth Users REST Endpoint」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Sal Ferrarello ](https://profiles.wordpress.org/salcode/)

[帮助将「Require Auth Users REST Endpoint」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/require-auth-users-rest-endpoint)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/require-auth-users-rest-endpoint/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/require-auth-users-rest-endpoint/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/require-auth-users-rest-endpoint/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/require-auth-users-rest-endpoint/)。

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**5 月前**
 *  活跃安装数量 **30+**
 *  WordPress 版本 ** 6.5 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  PHP 版本 ** 7.2 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/require-auth-users-rest-endpoint/)
 * 标签
 * [api](https://cn.wordpress.org/plugins/tags/api/)[authentication](https://cn.wordpress.org/plugins/tags/authentication/)
   [endpoint](https://cn.wordpress.org/plugins/tags/endpoint/)[rest](https://cn.wordpress.org/plugins/tags/rest/)
   [users](https://cn.wordpress.org/plugins/tags/users/)
 *  [高级视图](https://cn.wordpress.org/plugins/require-auth-users-rest-endpoint/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/require-auth-users-rest-endpoint/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/require-auth-users-rest-endpoint/reviews/)

## 贡献者

 *   [ Sal Ferrarello ](https://profiles.wordpress.org/salcode/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/require-auth-users-rest-endpoint/)