-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.4.0: gutenberg_register_post_types()
#5617
Labels
[Type] Bug
An existing feature does not function as intended
Comments
Another sighting in the wild https://wordpress.org/support/topic/php-fatal-error-with-version-2-4-0/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/WordPress/gutenberg/blob/v2.4.0/lib/register.php#L433 is written with the assumption that those role names exist in the system. This is not always the case, because roles can be deleted or renamed for multiple valid reasons.
As it stands, Gutenberg currently crashes my WP, because my user has two roles
administrator
andeditor
. For some reasonget_role( "editor" )
evaluates tonull
, thereby has nohas_cap()
method.My takeaway here is that we should check
get_role()
result for validity before proceeding.The text was updated successfully, but these errors were encountered: