humanmade / humanmade/authorship

Error message not correctly displayed

Open
#141 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
68
Forks
11
PR merge metrics
No merged PRs in 30d

Description

I have customized the capabilities, removing the possibility of creating guest users, but the editor is showing an error on displaying the error:
![image](https://github.com/humanmade/authorship/assets/23632632/74b08930-e121-42e9-a1cc-fa4015c13fe9)

I'm aware of https://github.com/humanmade/authorship/issues/76, but this issue is about showing the right error message provided from the backend.

### How to reproduce:

1. Add in a plugin a code like this

```
add_filter('user_has_cap', 'removeGuestAuthorCap', 9999);

function removeGuestAuthorCap(array $user_caps): array
{
unset($user_caps['create_guest_authors']);

return $user_caps;
}
```
2. Login to WordPress admin panel as an user that's not a Super Admin
3. Try to add a guest author to a post
4. The error message shown in the editor should report "undefined"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.