-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix undefined variable warning in gutenberg.php #12053
Conversation
gutenberg.php
Outdated
@@ -67,6 +67,7 @@ function the_gutenberg_project() { | |||
* @since 0.1.0 | |||
*/ | |||
function gutenberg_menu() { | |||
global $post; | |||
if ( ! gutenberg_can_edit_post( $post ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't make sense to keep the check actually because this menu is always rendered in the admin and not only when there's a global $post variable (post being edited).
I think the reasoning for the PR was to hide the menu if the rich-text preference is disabled But I don't think it's very important to check for it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to remove the check entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
47c0672
to
6ad33c1
Compare
Introduced an undefined global
$post
variable in 095d18f.Quick fix for that.
closes #12061