From 686072071f68da1cf21a1d2764830dda9cde32bd Mon Sep 17 00:00:00 2001 From: Ville Viklund Date: Wed, 31 May 2023 21:06:58 +0300 Subject: [PATCH] Add Force Login bypass --- src/NetworkSiteListPlugin.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/NetworkSiteListPlugin.php b/src/NetworkSiteListPlugin.php index 7011cc4..c0b04a0 100644 --- a/src/NetworkSiteListPlugin.php +++ b/src/NetworkSiteListPlugin.php @@ -95,6 +95,15 @@ public function hooks() { 'rest_api_init', [ $this, 'register_rest_routes' ] ); + + // Remove the force login filter from the REST API. + add_action( 'init', function() { + remove_filter( + 'rest_authentication_errors', + 'v_forcelogin_rest_access', + 99 + ); + } ); } /**