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

Update the minimum supported WordPress version to 5.7 #34536

Merged
merged 3 commits into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report_mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ the bug.
-->

## WordPress information
- WordPress version: <!-- e.g. "5.6.0". Find this in Tools → Site Health → Info → WordPress -->
- WordPress version: <!-- e.g. "5.8.0". Find this in Tools → Site Health → Info → WordPress -->
- Gutenberg version: <!-- e.g. "9.4.0" or "Not installed" -->
- Are all plugins except Gutenberg deactivated? <!-- "Yes" or "No" -->
- Are you using a default theme (e.g. Twenty Twenty-One)? <!-- "Yes" or "No" -->
Expand Down
6 changes: 3 additions & 3 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Gutenberg
* Plugin URI: https://github.com/WordPress/gutenberg
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
* Requires at least: 5.6
* Requires at least: 5.7
* Requires PHP: 5.6
* Version: 11.4.0
* Author: Gutenberg Team
Expand All @@ -26,7 +26,7 @@
function gutenberg_wordpress_version_notice() {
echo '<div class="error"><p>';
/* translators: %s: Minimum required version */
printf( __( 'Gutenberg requires WordPress %s or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' ), '5.6' );
printf( __( 'Gutenberg requires WordPress %s or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' ), '5.7' );
echo '</p></div>';

deactivate_plugins( array( 'gutenberg/gutenberg.php' ) );
Expand Down Expand Up @@ -64,7 +64,7 @@ function gutenberg_pre_init() {
// Compare against major release versions (X.Y) rather than minor (X.Y.Z)
// unless a minor release is the actual minimum requirement. WordPress reports
// X.Y for its major releases.
if ( version_compare( $version, '5.6', '<' ) ) {
if ( version_compare( $version, '5.7', '<' ) ) {
add_action( 'admin_notices', 'gutenberg_wordpress_version_notice' );
return;
}
Expand Down
59 changes: 0 additions & 59 deletions lib/block-supports/align.php

This file was deleted.

58 changes: 0 additions & 58 deletions lib/block-supports/custom-classname.php

This file was deleted.

61 changes: 0 additions & 61 deletions lib/block-supports/generated-classname.php

This file was deleted.

47 changes: 0 additions & 47 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ function gutenberg_override_script( $scripts, $handle, $src, $deps = array(), $v
$scripts->set_translations( $handle, 'default' );
}

// Remove this check once the minimum supported WordPress version is at least 5.7.
if ( 'wp-i18n' === $handle ) {
$ltr = 'rtl' === _x( 'ltr', 'text direction', 'default' ) ? 'rtl' : 'ltr';
$output = sprintf( "wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ '%s' ] }, 'default' );", $ltr );
$scripts->add_inline_script( 'wp-i18n', $output, 'after' );
}

/*
* Wp-editor module is exposed as window.wp.editor.
* Problem: there is quite some code expecting window.wp.oldEditor object available under window.wp.editor.
Expand Down Expand Up @@ -223,18 +216,6 @@ function gutenberg_register_vendor_scripts( $scripts ) {
'https://unpkg.com/react-dom@17.0.1/umd/react-dom' . $react_suffix . '.js',
array( 'react' )
);

/*
* This script registration and the corresponding function should be removed
* removed once the plugin is updated to support WordPress 5.7.0 and newer.
*/
gutenberg_register_vendor_script(
$scripts,
'object-fit-polyfill',
'https://unpkg.com/objectFitPolyfill@2.3.5/dist/objectFitPolyfill.min.js',
array(),
'2.3.5'
);
}
add_action( 'wp_default_scripts', 'gutenberg_register_vendor_scripts' );

Expand Down Expand Up @@ -797,31 +778,3 @@ function gutenberg_extend_block_editor_styles_html() {
add_action( 'admin_footer-post.php', 'gutenberg_extend_block_editor_styles_html' );
add_action( 'admin_footer-post-new.php', 'gutenberg_extend_block_editor_styles_html' );
add_action( 'admin_footer-widgets.php', 'gutenberg_extend_block_editor_styles_html' );

/**
* Adds a polyfill for object-fit in environments which do not support it.
*
* The script registration occurs in `gutenberg_register_vendor_scripts`, which
* should be removed in coordination with this function.
*
* Remove this when the minimum supported version is WordPress 5.7
*
* @see gutenberg_register_vendor_scripts
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
*
* @since 9.1.0
*
* @param WP_Scripts $scripts WP_Scripts object.
*/
function gutenberg_add_object_fit_polyfill( $scripts ) {
did_action( 'init' ) && $scripts->add_inline_script(
'wp-polyfill',
wp_get_script_polyfill(
$scripts,
array(
'"objectFit" in document.documentElement.style' => 'object-fit-polyfill',
)
)
);
}
add_action( 'wp_default_scripts', 'gutenberg_add_object_fit_polyfill', 20 );
3 changes: 0 additions & 3 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,9 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/global-styles.php';
require __DIR__ . '/pwa.php';

require __DIR__ . '/block-supports/generated-classname.php';
require __DIR__ . '/block-supports/elements.php';
require __DIR__ . '/block-supports/colors.php';
require __DIR__ . '/block-supports/align.php';
require __DIR__ . '/block-supports/typography.php';
require __DIR__ . '/block-supports/custom-classname.php';
require __DIR__ . '/block-supports/border.php';
require __DIR__ . '/block-supports/layout.php';
require __DIR__ . '/block-supports/spacing.php';
Expand Down