From ef02fdef4ad3644df327d8c48564dd3e9be31fa2 Mon Sep 17 00:00:00 2001 From: netzgestaltung Date: Mon, 21 Nov 2022 10:20:16 +0100 Subject: [PATCH] changed function names to avoid conflicts --- .../sandbox-restrict-user-enumeration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sandbox-restrict-user-enumeration/sandbox-restrict-user-enumeration.php b/sandbox-restrict-user-enumeration/sandbox-restrict-user-enumeration.php index 5fbaa40..ec5f86c 100644 --- a/sandbox-restrict-user-enumeration/sandbox-restrict-user-enumeration.php +++ b/sandbox-restrict-user-enumeration/sandbox-restrict-user-enumeration.php @@ -36,7 +36,7 @@ function sandbox_restrict_user_enumeration(){ // Removes the endpoints for '/wp/v2/users' - add_filter('rest_endpoints', 'sandbox_rest_endpoints'); + add_filter('rest_endpoints', 'sandbox_filter_rest_endpoint_users'); // Redirect Author Page to 404 add_action('template_redirect', 'sandbox_author_redirect'); @@ -55,7 +55,7 @@ function sandbox_restrict_user_enumeration(){ * - https://wordpress.stackexchange.com/questions/388307/disable-part-of-endpoints-wordpress-api * - https://wpreset.com/remove-default-wordpress-rest-api-routes-endpoints/ */ -function sandbox_rest_endpoints($endpoints){ +function sandbox_filter_rest_endpoint_users($endpoints){ $routes = array('/wp/v2/users', '/wp/v2/users/(?P[\d]+)'); if ( !is_user_logged_in() || current_user_can_for_blog(get_current_blog_id(), 'edit_posts') === false ) {