Skip to content
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

$post not defined in gutenberg_menu() #12061

Closed
mrmadhat opened this issue Nov 19, 2018 · 0 comments · Fixed by #12053
Closed

$post not defined in gutenberg_menu() #12061

mrmadhat opened this issue Nov 19, 2018 · 0 comments · Fixed by #12053
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Bug An existing feature does not function as intended

Comments

@mrmadhat
Copy link
Contributor

Describe the bug
gutenberg_menu() calls gutenberg_can_edit_post() with $post as an argument but it is not defined at that point.

To Reproduce
Steps to reproduce the behavior:

  1. Load the wp-admin or single post
  2. See error

Expected behavior
Check for the existing of $post before using it or using global $post so $post will at least be defined even if it's value is NULL

Screenshots
(added die() after call to gutenberg_can_edit_post() so error can be seen)
image

Desktop (please complete the following information):

  • OS: IOS
  • Browser Chrome

Additional context

  • Master
@designsimply designsimply added [Type] Bug An existing feature does not function as intended Framework Issues related to broader framework topics, especially as it relates to javascript labels Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Bug An existing feature does not function as intended
Projects
None yet
2 participants