Eintrag

deactivate wp-json

based on article at heise.de/ct

1
2
3
4
5
6
7
8
9
add_filter( 'rest_authentication_errors', function( $result ) {
if ( ! empty( $result ) ) {
return $result;
}
if ( ! is_user_logged_in() ) {
return new WP_Error( '401', 'not allowed.', array('status' => 401) );
}
return $result;
});
Dieser Eintrag ist vom Autor unter CC BY 4.0 lizensiert.