From 4fb15c06800b28bfef9ace257ede68c20ed4ee7a Mon Sep 17 00:00:00 2001 From: Jeffrey Carandang Date: Sat, 22 Aug 2020 02:37:06 +0800 Subject: [PATCH] Fix 'permission_callback' error on WordPress 5.5 --- includes/Classifai/Services/ImageProcessing.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/Classifai/Services/ImageProcessing.php b/includes/Classifai/Services/ImageProcessing.php index 3b9120382..3d9e33553 100644 --- a/includes/Classifai/Services/ImageProcessing.php +++ b/includes/Classifai/Services/ImageProcessing.php @@ -75,18 +75,20 @@ public function register_endpoints() { 'classifai/v1', 'alt-tags/(?P\d+)', [ - 'methods' => 'GET', - 'callback' => [ $this, 'provider_endpoint_callback' ], - 'args' => [ 'route' => 'alt-tags' ], + 'methods' => 'GET', + 'callback' => [ $this, 'provider_endpoint_callback' ], + 'args' => [ 'route' => 'alt-tags' ], + 'permission_callback' => '__return_true', ] ); register_rest_route( 'classifai/v1', 'image-tags/(?P\d+)', [ - 'methods' => 'GET', - 'callback' => [ $this, 'provider_endpoint_callback' ], - 'args' => [ 'route' => 'image-tags' ], + 'methods' => 'GET', + 'callback' => [ $this, 'provider_endpoint_callback' ], + 'args' => [ 'route' => 'image-tags' ], + 'permission_callback' => '__return_true', ] ); }