plugin-icon

Require Auth Users REST Endpoint

Require authentication when accessing the /wp-json/wp/v2/users REST API endpoint.
版本
1.0.0
活躍安裝總數
30
最近更新:
Apr 16, 2025
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

免費使用Business方案
目前已測試版本
WordPress 6.8.3
此外掛程式已可供下載,並可用於你 系統。