Created
February 21, 2023 16:03
-
-
Save nickalexej/b8247476ace02d01ba21aeae00e6dbe1 to your computer and use it in GitHub Desktop.
deaktiviert die restapi für nicht authentifizierte user
This file contains 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
<? | |
add_filter( 'rest_authentication_errors', 'disable_rest_api' ); | |
function disable_rest_api( $access ) { | |
return new WP_Error( 'rest_disabled', __( 'The WordPress REST API has been disabled on this site.' ), array( 'status' => rest_authorization_required_code() ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment