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

Merged
merged 2 commits into from Nov 19, 2018

Conversation

Projects
None yet
3 participants
@earnjam
Contributor

earnjam commented Nov 19, 2018

Introduced an undefined global $post variable in 095d18f.

Quick fix for that.

closes #12061

@gziolo gziolo requested a review from WordPress/gutenberg-core Nov 19, 2018

@gziolo gziolo added this to the 4.5 milestone Nov 19, 2018

@@ -67,6 +67,7 @@ function the_gutenberg_project() {
* @since 0.1.0
*/
function gutenberg_menu() {
global $post;
if ( ! gutenberg_can_edit_post( $post ) ) {

This comment has been minimized.

@youknowriad

youknowriad Nov 19, 2018

Contributor

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.

This comment has been minimized.

@youknowriad

youknowriad Nov 19, 2018

Contributor

I pushed a commit to remove the check entirely.

@youknowriad youknowriad referenced this pull request Nov 19, 2018

Merged

Honor the Disable Visual Editor setting #12000

2 of 4 tasks complete
@youknowriad

LGTM 👍

@gziolo gziolo requested a review from mkaz Nov 19, 2018

@youknowriad youknowriad referenced this pull request Nov 19, 2018

Closed

Fix/post not defined #12063

@youknowriad youknowriad force-pushed the fix/undefined-global-post branch from 47c0672 to 6ad33c1 Nov 19, 2018

@youknowriad youknowriad merged commit 2aea727 into master Nov 19, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@youknowriad youknowriad deleted the fix/undefined-global-post branch Nov 19, 2018

grey-rsi pushed a commit to OnTheGoSystems/gutenberg that referenced this pull request Nov 22, 2018

Fix undefined variable warning in gutenberg.php (WordPress#12053)
* Fix undefined variable warning

* Remove the gutenberg menu check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment