humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
66 stars 7 forks source link

Error message not correctly displayed #141

Open dottxado opened 10 months ago

dottxado commented 10 months ago

I have customized the capabilities, removing the possibility of creating guest users, but the editor is showing an error on displaying the error: image

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;
    }
  1. Login to WordPress admin panel as an user that's not a Super Admin
  2. Try to add a guest author to a post
  3. The error message shown in the editor should report "undefined"