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

Add check to ensure site is using WordPress 4.8 #1319

Merged

Conversation

@aaronjorbin
Copy link
Member

aaronjorbin commented Jun 20, 2017

Fixes #1290

@aaronjorbin aaronjorbin force-pushed the aaronjorbin:add/minimum-wordpress-version-check branch from a02c660 to 0956714 Jun 20, 2017
@aaronjorbin aaronjorbin force-pushed the aaronjorbin:add/minimum-wordpress-version-check branch from 0956714 to b41702b Jun 20, 2017
function gutenberg_wordpress_version_notice() {
echo '<div class="error"><p>';
echo __( 'Gutenburg requires WordPress 4.8 to function properly. Please upgrade WordPress before activating Gutenburg.', 'gutenberg' );
echo '</p></div>';;

This comment has been minimized.

Copy link
@westonruter

westonruter Jun 20, 2017

Member

There's a doubled semicolon here.

This comment has been minimized.

Copy link
@aaronjorbin

aaronjorbin Jun 20, 2017

Author Member

Thanks.

@nylen

This comment has been minimized.

Copy link
Member

nylen commented Jun 20, 2017

deactivate_plugins( array( 'gutenberg/gutenberg.php' ) );

I would not have thought to deactivate the plugin here. Is this common practice, or would it be better to keep this notice around?

@aaronjorbin

This comment has been minimized.

Copy link
Member Author

aaronjorbin commented Jun 20, 2017

@nylen I think it's best to deactivate the plugin so that it's very clear that Gutenberg is not in use and then after WordPress has been updated, the user can activate Gutenberg and see it in all its might.

@nylen

This comment has been minimized.

Copy link
Member

nylen commented Jun 20, 2017

A few fixes in the latest commits, including moving the PHP version check to a separate file, with the goal of keeping the gutenberg.php entry point extremely simple and short.

Moving the version check to its own function also fixes the build, because the plugin was loaded via a function during PHPUnit runs, which meant that the $wp_version global was not available at the top level of the code.

@nylen

This comment has been minimized.

Copy link
Member

nylen commented Jun 20, 2017

Thanks for working on this. It's working well (tested by temporarily changing $wp_version in my dev install); let's merge it.

@nylen nylen merged commit 537f436 into WordPress:master Jun 20, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.