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 Gutenberg plugin to require at least the WP 6.1 version #50079

Merged
merged 7 commits into from
Apr 28, 2023
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 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 block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.0
* Requires at least: 6.1
* Requires PHP: 5.6
* Version: 15.6.2
* Author: Gutenberg Team
Expand Down
5 changes: 2 additions & 3 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
$wide_max_width_value = $wide_size ? $wide_size : $content_size;

// Make sure there is a single CSS rule, and all tags are stripped for security.
// TODO: Use `safecss_filter_attr` instead when the minimum required WP version is >= 6.1.
$all_max_width_value = wp_strip_all_tags( explode( ';', $all_max_width_value )[0] );
$wide_max_width_value = wp_strip_all_tags( explode( ';', $wide_max_width_value )[0] );
$all_max_width_value = safecss_filter_attr( explode( ';', $all_max_width_value )[0] );
$wide_max_width_value = safecss_filter_attr( explode( ';', $wide_max_width_value )[0] );

$margin_left = 'left' === $justify_content ? '0 !important' : 'auto !important';
$margin_right = 'right' === $justify_content ? '0 !important' : 'auto !important';
Expand Down
38 changes: 0 additions & 38 deletions lib/block-supports/typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,44 +211,6 @@ function gutenberg_typography_get_preset_inline_style_value( $style_value, $css_
return sprintf( 'var(--wp--preset--%s--%s);', $css_property, $slug );
}

/**
* This method is no longer used and has been deprecated in Core since 6.1.0.
*
* It can be deleted once Gutenberg's minimum supported WordPress version is >= 6.1
*
* Generates an inline style for a typography feature e.g. text decoration,
* text transform, and font style.
*
* @since 5.8.0
* @deprecated 6.1.0
*
* @param array $attributes Block's attributes.
* @param string $feature Key for the feature within the typography styles.
* @param string $css_property Slug for the CSS property the inline style sets.
*
* @return string CSS inline style.
*/
function gutenberg_typography_get_css_variable_inline_style( $attributes, $feature, $css_property ) {
// Retrieve current attribute value or skip if not found.
$style_value = _wp_array_get( $attributes, array( 'style', 'typography', $feature ), false );
if ( ! $style_value ) {
return;
}

// If we don't have a preset CSS variable, we'll assume it's a regular CSS value.
if ( ! str_contains( $style_value, "var:preset|{$css_property}|" ) ) {
return sprintf( '%s:%s;', $css_property, $style_value );
}

// We have a preset CSS variable as the style.
// Get the style value from the string and return CSS style.
$index_to_splice = strrpos( $style_value, '|' ) + 1;
$slug = substr( $style_value, $index_to_splice );

// Return the actual CSS inline style e.g. `text-decoration:var(--wp--preset--text-decoration--underline);`.
return sprintf( '%s:var(--wp--preset--%s--%s);', $css_property, $css_property, $slug );
}

/**
* Renders typography styles/content to the block wrapper.
*
Expand Down
3 changes: 3 additions & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ function gutenberg_register_packages_scripts( $scripts ) {
case 'wp-edit-site':
array_push( $dependencies, 'wp-dom-ready' );
break;
case 'wp-preferences':
array_push( $dependencies, 'wp-preferences-persistence' );
break;
}

// Get the path from Gutenberg directory as expected by `gutenberg_url`.
Expand Down
177 changes: 0 additions & 177 deletions lib/compat/wordpress-6.1/block-editor-settings.php

This file was deleted.

Loading