Skip to content
Closed
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
544 changes: 278 additions & 266 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,52 +82,52 @@
"@wordpress/api-fetch": "5.1.1",
"@wordpress/autop": "3.1.1",
"@wordpress/blob": "3.1.1",
"@wordpress/block-directory": "2.1.16",
"@wordpress/block-editor": "6.1.9",
"@wordpress/block-library": "3.2.14",
"@wordpress/block-directory": "2.1.17",
"@wordpress/block-editor": "6.1.10",
"@wordpress/block-library": "3.2.15",
"@wordpress/block-serialization-default-parser": "4.1.1",
"@wordpress/blocks": "9.1.5",
"@wordpress/components": "14.1.6",
"@wordpress/components": "14.1.7",
"@wordpress/compose": "4.1.3",
"@wordpress/core-data": "3.1.9",
"@wordpress/customize-widgets": "1.0.15",
"@wordpress/customize-widgets": "1.0.16",
"@wordpress/data": "5.1.3",
"@wordpress/data-controls": "2.1.3",
"@wordpress/date": "4.1.1",
"@wordpress/deprecated": "3.1.1",
"@wordpress/dom": "3.1.2",
"@wordpress/dom-ready": "3.1.1",
"@wordpress/edit-post": "4.1.16",
"@wordpress/edit-widgets": "2.1.16",
"@wordpress/editor": "10.1.12",
"@wordpress/edit-post": "4.1.17",
"@wordpress/edit-widgets": "2.1.17",
"@wordpress/editor": "10.1.13",
"@wordpress/element": "3.1.1",
"@wordpress/escape-html": "2.1.1",
"@wordpress/format-library": "2.1.9",
"@wordpress/format-library": "2.1.10",
"@wordpress/hooks": "3.1.1",
"@wordpress/html-entities": "3.1.1",
"@wordpress/i18n": "4.1.1",
"@wordpress/icons": "4.0.2",
"@wordpress/interface": "3.1.7",
"@wordpress/interface": "3.1.8",
"@wordpress/is-shallow-equal": "4.1.1",
"@wordpress/keyboard-shortcuts": "2.1.3",
"@wordpress/keycodes": "3.1.1",
"@wordpress/list-reusable-blocks": "2.1.6",
"@wordpress/list-reusable-blocks": "2.1.7",
"@wordpress/media-utils": "2.1.1",
"@wordpress/notices": "3.1.3",
"@wordpress/nux": "4.1.6",
"@wordpress/nux": "4.1.7",
"@wordpress/plugins": "3.1.3",
"@wordpress/primitives": "2.1.1",
"@wordpress/priority-queue": "2.1.1",
"@wordpress/redux-routine": "4.1.1",
"@wordpress/reusable-blocks": "2.1.12",
"@wordpress/reusable-blocks": "2.1.13",
"@wordpress/rich-text": "4.1.3",
"@wordpress/server-side-render": "2.1.7",
"@wordpress/server-side-render": "2.1.8",
"@wordpress/shortcode": "3.1.1",
"@wordpress/token-list": "2.1.1",
"@wordpress/url": "3.1.1",
"@wordpress/viewport": "3.1.3",
"@wordpress/warning": "2.1.1",
"@wordpress/widgets": "1.1.14",
"@wordpress/widgets": "1.1.15",
"@wordpress/wordcount": "3.1.1",
"backbone": "1.4.0",
"clipboard": "2.0.8",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/wp-includes/blocks/legacy-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ function render_block_core_legacy_widget( $attributes ) {
$widget_key = $wp_widget_factory->get_widget_key( $id_base );
$widget_object = $wp_widget_factory->get_widget_object( $id_base );
} else {
/*
* This file is copied from the published @wordpress/widgets package when WordPress
* Core is built. Because the package is a dependency of both WordPress Core and the
* Gutenberg plugin where the block editor is developed, this fallback condition is
* required until the minimum required version of WordPress for the plugin is raised
* to 5.8.
*/
$widget_key = gutenberg_get_widget_key( $id_base );
$widget_object = gutenberg_get_widget_object( $id_base );
}
Expand Down
60 changes: 0 additions & 60 deletions src/wp-includes/blocks/post-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,63 +86,3 @@ function register_block_core_post_template() {
);
}
add_action( 'init', 'register_block_core_post_template' );

/**
* Renders the legacy `core/query-loop` block on the server.
* It triggers a developer warning and then calls the renamed
* block's `render_callback` function output.
*
* This can be removed when WordPress 5.9 is released.
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
*
* @return string Returns the output of the query, structured using the layout defined by the block's inner blocks.
*/
function render_legacy_query_loop_block( $attributes, $content, $block ) {
trigger_error(
/* translators: %1$s: Block type */
sprintf( __( 'Block %1$s has been renamed to Post Template. %1$s will be supported until WordPress version 5.9.' ), $block->name ),
headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
);
return render_block_core_post_template( $attributes, $content, $block );
}

/**
* Complements the renaming of `Query Loop` to `Post Template`.
* This ensures backwards compatibility for any users running the Gutenberg
* plugin who have used Query Loop prior to its renaming.
*
* This can be removed when WordPress 5.9 is released.
*
* @see https://github.com/WordPress/gutenberg/pull/32514
*/
function gutenberg_register_legacy_query_loop_block() {
$registry = WP_Block_Type_Registry::get_instance();
if ( $registry->is_registered( 'core/query-loop' ) ) {
unregister_block_type( 'core/query-loop' );
}
register_block_type(
'core/query-loop',
array(
'category' => 'design',
'uses_context' => array(
'queryId',
'query',
'queryContext',
'displayLayout',
'templateSlug',
),
'supports' => array(
'reusable' => false,
'html' => false,
'align' => true,
),
'style' => 'wp-block-post-template',
'render_callback' => 'render_legacy_query_loop_block',
'skip_inner_blocks' => true,
)
);
}
add_action( 'init', 'gutenberg_register_legacy_query_loop_block' );
70 changes: 34 additions & 36 deletions src/wp-includes/blocks/site-logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
function render_block_core_site_logo( $attributes ) {
$adjust_width_height_filter = function ( $image ) use ( $attributes ) {
if ( empty( $attributes['width'] ) ) {
if ( empty( $attributes['width'] ) || empty( $image ) ) {
return $image;
}
$height = (float) $attributes['width'] / ( (float) $image[1] / (float) $image[2] );
Expand Down Expand Up @@ -111,54 +111,52 @@ function _override_custom_logo_theme_mod( $custom_logo ) {
/**
* Updates the site_logo option when the custom_logo theme-mod gets updated.
*
* This function is hooked on "update_option_theme_mods_$theme" and not
* "pre_set_theme_mod_custom_logo" because by hooking in `update_option`
* the function accounts for remove_theme_mod() as well.
*
* @param mixed $old_value The old option value.
* @param mixed $value The new option value.
* @param mixed $value Attachment ID of the custom logo or an empty value.
* @return mixed
*/
function _sync_custom_logo_to_site_logo( $old_value, $value ) {
// Delete the option when the custom logo does not exist or was removed.
// This step ensures the option stays in sync.
if ( empty( $value['custom_logo'] ) ) {
function _sync_custom_logo_to_site_logo( $value ) {
if ( empty( $value ) ) {
delete_option( 'site_logo' );
} else {
remove_action( 'update_option_site_logo', '_sync_site_logo_to_custom_logo' );
update_option( 'site_logo', $value['custom_logo'] );
add_action( 'update_option_site_logo', '_sync_site_logo_to_custom_logo', 10, 2 );
update_option( 'site_logo', $value );
}

return $value;
}

add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );

/**
* Hooks `_sync_custom_logo_to_site_logo` in `update_option_theme_mods_$theme`.
* Deletes the site_logo when the custom_logo theme mod is removed.
*
* Runs on `setup_theme` to account for dynamically-switched themes in the Customizer.
* @param array $old_value Previous theme mod settings.
* @param array $value Updated theme mod settings.
*/
function _sync_custom_logo_to_site_logo_on_setup_theme() {
$theme = get_option( 'stylesheet' );
add_action( "update_option_theme_mods_$theme", '_sync_custom_logo_to_site_logo', 10, 2 );
function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) {
// If the custom_logo is being unset, it's being removed from theme mods.
if ( isset( $old_value['custom_logo'] ) && ! isset( $value['custom_logo'] ) ) {
delete_option( 'site_logo' );
}
}
add_action( 'setup_theme', '_sync_custom_logo_to_site_logo_on_setup_theme', 11 );

/**
* Updates the custom_logo theme-mod when the site_logo option gets updated.
*
* @param mixed $old_value The old option value.
* @param mixed $value The new option value.
*
* @return void
* Deletes the site logo when all theme mods are being removed.
*/
function _sync_site_logo_to_custom_logo( $old_value, $value ) {
// Delete the option when the custom logo does not exist or was removed.
// This step ensures the option stays in sync.
if ( empty( $value ) ) {
remove_theme_mod( 'custom_logo' );
} else {
remove_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
set_theme_mod( 'custom_logo', $value );
add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
function _delete_site_logo_on_remove_theme_mods() {
if ( false !== get_theme_support( 'custom-logo' ) ) {
delete_option( 'site_logo' );
}
}

add_action( 'update_option_site_logo', '_sync_site_logo_to_custom_logo', 10, 2 );
/**
* Hooks `_delete_site_logo_on_remove_custom_logo` in `update_option_theme_mods_$theme`.
* Hooks `_delete_site_logo_on_remove_theme_mods` in `delete_option_theme_mods_$theme`.
*
* Runs on `setup_theme` to account for dynamically-switched themes in the Customizer.
*/
function _delete_site_logo_on_remove_custom_logo_on_setup_theme() {
$theme = get_option( 'stylesheet' );
add_action( "update_option_theme_mods_$theme", '_delete_site_logo_on_remove_custom_logo', 10, 2 );
add_action( "delete_option_theme_mods_$theme", '_delete_site_logo_on_remove_theme_mods' );
}
add_action( 'setup_theme', '_delete_site_logo_on_remove_custom_logo_on_setup_theme', 11 );
26 changes: 5 additions & 21 deletions src/wp-includes/blocks/site-logo/editor-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,17 @@
max-width: 100%;
}
.wp-block-site-logo .components-placeholder {
justify-content: flex-start;
min-height: auto;
height: 120px;
padding: 8px;
padding: 12px;
}
.wp-block-site-logo .components-placeholder .components-placeholder__label {
margin-top: 12px;
white-space: nowrap;
}
.wp-block-site-logo .components-placeholder .components-placeholder__label .block-editor-block-icon {
.wp-block-site-logo .components-placeholder .components-placeholder__label .block-editor-block-icon,
.wp-block-site-logo .components-placeholder .components-placeholder__label > svg {
margin-left: 4px;
}
.wp-block-site-logo .components-placeholder .components-form-file-upload {
Expand All @@ -126,23 +129,4 @@
}
.wp-block-site-logo .components-placeholder .components-drop-zone__content-text {
display: none;
}

.editor-styles-wrapper .site-logo_placeholder {
display: flex;
flex-direction: row;
align-items: flex-start;
border-radius: 2px;
background-color: #fff;
box-shadow: inset 0 0 0 1px #1e1e1e;
padding: 12px;
}
.editor-styles-wrapper .site-logo_placeholder svg {
margin-left: 12px;
}
.editor-styles-wrapper .site-logo_placeholder p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
margin: 0;
line-height: initial;
}
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/site-logo/editor-rtl.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 5 additions & 21 deletions src/wp-includes/blocks/site-logo/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,17 @@
max-width: 100%;
}
.wp-block-site-logo .components-placeholder {
justify-content: flex-start;
min-height: auto;
height: 120px;
padding: 8px;
padding: 12px;
}
.wp-block-site-logo .components-placeholder .components-placeholder__label {
margin-top: 12px;
white-space: nowrap;
}
.wp-block-site-logo .components-placeholder .components-placeholder__label .block-editor-block-icon {
.wp-block-site-logo .components-placeholder .components-placeholder__label .block-editor-block-icon,
.wp-block-site-logo .components-placeholder .components-placeholder__label > svg {
margin-right: 4px;
}
.wp-block-site-logo .components-placeholder .components-form-file-upload {
Expand All @@ -126,23 +129,4 @@
}
.wp-block-site-logo .components-placeholder .components-drop-zone__content-text {
display: none;
}

.editor-styles-wrapper .site-logo_placeholder {
display: flex;
flex-direction: row;
align-items: flex-start;
border-radius: 2px;
background-color: #fff;
box-shadow: inset 0 0 0 1px #1e1e1e;
padding: 12px;
}
.editor-styles-wrapper .site-logo_placeholder svg {
margin-right: 12px;
}
.editor-styles-wrapper .site-logo_placeholder p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
margin: 0;
line-height: initial;
}
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/site-logo/editor.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,18 @@ class WP_Theme_JSON {
const ALLOWED_SETTINGS = array(
'color' => array(
'custom' => null,
'customDuotone' => null,
'customGradient' => null,
'duotone' => null,
'gradients' => null,
'link' => null,
'palette' => null,
),
'custom' => null,
'layout' => null,
'layout' => array(
'contentSize' => null,
'wideSize' => null,
),
'spacing' => array(
'customMargin' => null,
'customPadding' => null,
Expand Down
5 changes: 3 additions & 2 deletions src/wp-includes/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"settings": {
"color": {
"custom": true,
"customGradient": true,
"customDuotone": true,
"customGradient": true,
"link": false,
"duotone": [
{
"name": "Dark grayscale" ,
Expand Down Expand Up @@ -108,7 +110,6 @@
"slug": "midnight"
}
],
"link": false,
"palette": [
{
"name": "Black",
Expand Down