| @@ -30,22 +30,16 @@ | ||
| 30 | 30 | private UserGroupHandler $userGroupHandler |
| 31 | 31 | ) { |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - private function hasAuthorAccess(string $objectType, int|string|null $objectId): bool | |
| 34 | + private function hasAuthorAccess(string $objectType, int|string $objectId): bool | |
| 35 | 35 | { |
| 36 | 36 | if ($this->mainConfig->authorsHasAccessToOwn() === true |
| 37 | 37 | && $this->objectHandler->isPostType($objectType) |
| 38 | 38 | ) { |
| 39 | 39 | $post = $this->objectHandler->getPost($objectId); |
| 40 | - | |
| 41 | - if ($post === false) { | |
| 42 | - return false; | |
| 43 | - } | |
| 44 | - | |
| 45 | - $currentUserId = $this->wordpress->getCurrentUser()->ID; | |
| 46 | - return $currentUserId !== 0 | |
| 47 | - && $currentUserId === (int) $post->post_author; | |
| 40 | + return $post !== false | |
| 41 | + && $this->wordpress->getCurrentUser()->ID === (int) $post->post_author; | |
| 48 | 42 | } |
| 49 | 43 | |
| 50 | 44 | return false; |
| 51 | 45 | } |