Skip to content

Instantly share code, notes, and snippets.

@kirasiris
Created February 3, 2018 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirasiris/c8148f7b05bf127430ede03cb81d2cc0 to your computer and use it in GitHub Desktop.
Save kirasiris/c8148f7b05bf127430ede03cb81d2cc0 to your computer and use it in GitHub Desktop.
<?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