Created
February 3, 2018 11:13
-
-
Save kirasiris/c8148f7b05bf127430ede03cb81d2cc0 to your computer and use it in GitHub Desktop.
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
<?php | |
// Desabilitar accesso publico a REST API /wp-json | |
function kuaf_restricted_rest_api_access( $access ) { | |
return new WP_Error( 'rest_cannot_access', 'Lo siento pero he bloqueado el REST API de la website para evitar el accesso publico al contenido de la website', array( | |
'status' => 403 | |
) ); | |
} | |
add_filter( 'rest_authentication_errors', 'kuaf_restricted_rest_api_access' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment