Created
March 2, 2023 09:05
-
-
Save beatwiz/70b6dbcc9ec68883535b9c6984dfa5f9 to your computer and use it in GitHub Desktop.
Block WP JSON API Get Users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Block Users JSON API | |
*/ | |
add_filter('rest_endpoints', function ($endpoints) { | |
if (isset($endpoints['/wp/v2/users'])) { | |
unset($endpoints['/wp/v2/users']); | |
} | |
return $endpoints; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment