Manually created user with custom roles are not available in the author list in WordPress

- No category

If you found this article is probaly because you are facing that issue.

When an user is created manually with custom user roles happen that is not assigned to them as pecific usermeta that is deprecated.

This usermeta is level_1 that enable to add them as author so in Gutenberg but also in WordPress the user is not listed also if have the capabilities.

There is a long time (7 years) ticket in WordPress Trac, to track the problem but is still not fixed.

If you try to assign that as capability doesn’t work because need to be an usermeta and capabilities are saved in another place.

With this little piece of code you will fix the problem, the problem is that you have to execute any time you need to fix it.

So probably is possible to use an hook to execute it only when is really needed.

Liked it? Take a second to support Mte90 on Patreon!

Become a Patreon
All the stuff released in this website, where the author is Daniele Scasciafratte, is under the GPL 2.0 license except when the resources have their licenses.

Leave a Reply