/** * Check if the posted username and secret matches what's in the app. * * @param WP_REST_Request $request Full data about the request. * @return WP_Error|bool */ public function create_item_permissions_check($request) { $service = new ServiceTranslation(); if ($service->getUserName() == $request->getUserName() && $service->getSecret() == $request->getSecret()) { return true; } return false; }