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
438 changes: 218 additions & 220 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@wordpress/dependency-extraction-webpack-plugin": "3.1.4",
"@wordpress/e2e-test-utils": "5.3.0",
"@wordpress/library-export-default-webpack-plugin": "2.0.5",
"@wordpress/scripts": "16.1.2",
"@wordpress/scripts": "16.1.3",
"autoprefixer": "^9.8.6",
"chalk": "4.1.1",
"check-node-version": "4.1.0",
Expand Down 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.8",
"@wordpress/block-editor": "6.1.4",
"@wordpress/block-library": "3.2.7",
"@wordpress/block-directory": "2.1.10",
"@wordpress/block-editor": "6.1.5",
"@wordpress/block-library": "3.2.8",
"@wordpress/block-serialization-default-parser": "4.1.1",
"@wordpress/blocks": "9.1.4",
"@wordpress/components": "14.1.3",
"@wordpress/components": "14.1.4",
"@wordpress/compose": "4.1.2",
"@wordpress/core-data": "3.1.7",
"@wordpress/customize-widgets": "1.0.7",
"@wordpress/customize-widgets": "1.0.9",
"@wordpress/data": "5.1.2",
"@wordpress/data-controls": "2.1.2",
"@wordpress/date": "4.1.1",
"@wordpress/deprecated": "3.1.1",
"@wordpress/dom": "3.1.1",
"@wordpress/dom-ready": "3.1.1",
"@wordpress/edit-post": "4.1.8",
"@wordpress/edit-widgets": "2.1.8",
"@wordpress/editor": "10.1.7",
"@wordpress/edit-post": "4.1.10",
"@wordpress/edit-widgets": "2.1.10",
"@wordpress/editor": "10.1.8",
"@wordpress/element": "3.1.1",
"@wordpress/escape-html": "2.1.1",
"@wordpress/format-library": "2.1.4",
"@wordpress/format-library": "2.1.5",
"@wordpress/hooks": "3.1.1",
"@wordpress/html-entities": "3.1.1",
"@wordpress/i18n": "4.1.1",
"@wordpress/icons": "4.0.1",
"@wordpress/interface": "3.1.3",
"@wordpress/interface": "3.1.5",
"@wordpress/is-shallow-equal": "4.1.1",
"@wordpress/keyboard-shortcuts": "2.1.2",
"@wordpress/keycodes": "3.1.1",
"@wordpress/list-reusable-blocks": "2.1.3",
"@wordpress/list-reusable-blocks": "2.1.4",
"@wordpress/media-utils": "2.1.1",
"@wordpress/notices": "3.1.2",
"@wordpress/nux": "4.1.3",
"@wordpress/nux": "4.1.4",
"@wordpress/plugins": "3.1.2",
"@wordpress/primitives": "2.1.1",
"@wordpress/priority-queue": "2.1.1",
"@wordpress/redux-routine": "4.1.1",
"@wordpress/reusable-blocks": "2.1.7",
"@wordpress/reusable-blocks": "2.1.8",
"@wordpress/rich-text": "4.1.2",
"@wordpress/server-side-render": "2.1.4",
"@wordpress/server-side-render": "2.1.5",
"@wordpress/shortcode": "3.1.1",
"@wordpress/token-list": "2.1.1",
"@wordpress/url": "3.1.1",
"@wordpress/viewport": "3.1.2",
"@wordpress/warning": "2.1.1",
"@wordpress/widgets": "1.1.7",
"@wordpress/widgets": "1.1.9",
"@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.

20 changes: 10 additions & 10 deletions src/wp-includes/blocks/legacy-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ function render_block_core_legacy_widget( $attributes ) {
return '';
}

if ( method_exists( $wp_widget_factory, 'get_widget_object' ) ) {
$widget_object = $wp_widget_factory->get_widget_object( $attributes['idBase'] );
$id_base = $attributes['idBase'];
if ( method_exists( $wp_widget_factory, 'get_widget_key' ) ) {
$widget_key = $wp_widget_factory->get_widget_key( $id_base );
} else {
$widget_object = gutenberg_get_widget_object( $attributes['idBase'] );
$widget_key = gutenberg_get_widget_key( $id_base );
}

if ( ! $widget_object ) {
if ( ! $widget_key ) {
return '';
}

Expand All @@ -45,7 +46,7 @@ function render_block_core_legacy_widget( $attributes ) {
}

ob_start();
the_widget( get_class( $widget_object ), $instance );
the_widget( $widget_key, $instance );
return ob_get_clean();
}

Expand Down Expand Up @@ -90,7 +91,6 @@ function handle_legacy_widget_preview_iframe() {
<style>
/* Reset theme styles */
html, body, #page, #content {
background: #FFF !important;
padding: 0 !important;
margin: 0 !important;
}
Expand All @@ -114,7 +114,7 @@ function handle_legacy_widget_preview_iframe() {
exit;
}

// Ensure handle_legacy_widget_preview_iframe() is called after Core's
// register_block_core_legacy_widget() (priority = 10) and after Gutenberg's
// register_block_core_legacy_widget() (priority = 20).
add_action( 'init', 'handle_legacy_widget_preview_iframe', 21 );
// Use admin_init instead of init to ensure get_current_screen function is already available.
// This isn't strictly required, but enables better compatibility with existing plugins.
// See: https://github.com/WordPress/gutenberg/issues/32624.
add_action( 'admin_init', 'handle_legacy_widget_preview_iframe', 20 );
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/loginout/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"apiVersion": 2,
"name": "core/loginout",
"title": "Login/out",
"category": "design",
"category": "theme",
"description": "Show login & logout links.",
"keywords": [ "login", "logout", "form" ],
"textdomain": "default",
Expand Down
12 changes: 6 additions & 6 deletions src/wp-includes/blocks/page-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function block_core_page_list_build_css_font_sizes( $context ) {
*
* @return string List markup.
*/
function render_nested_page_list( $nested_pages ) {
function block_core_page_list_render_nested_page_list( $nested_pages ) {
if ( empty( $nested_pages ) ) {
return;
}
Expand All @@ -109,7 +109,7 @@ function render_nested_page_list( $nested_pages ) {
) . '</a>';
if ( isset( $page['children'] ) ) {
$markup .= '<span class="wp-block-page-list__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';
$markup .= '<ul class="submenu-container">' . render_nested_page_list( $page['children'] ) . '</ul>';
$markup .= '<ul class="submenu-container">' . block_core_page_list_render_nested_page_list( $page['children'] ) . '</ul>';
}
$markup .= '</li>';
}
Expand All @@ -124,13 +124,13 @@ function render_nested_page_list( $nested_pages ) {
*
* @return array The nested array of pages.
*/
function nest_pages( $current_level, $children ) {
function block_core_page_list_nest_pages( $current_level, $children ) {
if ( empty( $current_level ) ) {
return;
}
foreach ( (array) $current_level as $key => $current ) {
if ( isset( $children[ $key ] ) ) {
$current_level[ $key ]['children'] = nest_pages( $children[ $key ], $children );
$current_level[ $key ]['children'] = block_core_page_list_nest_pages( $children[ $key ], $children );
}
}
return $current_level;
Expand Down Expand Up @@ -180,11 +180,11 @@ function render_block_core_page_list( $attributes, $content, $block ) {
}
}

$nested_pages = nest_pages( $top_level_pages, $pages_with_children );
$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );

$wrapper_markup = '<ul %1$s>%2$s</ul>';

$items_markup = render_nested_page_list( $nested_pages );
$items_markup = block_core_page_list_render_nested_page_list( $nested_pages );

$colors = block_core_page_list_build_css_colors( $block->context );
$font_sizes = block_core_page_list_build_css_font_sizes( $block->context );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-content/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"apiVersion": 2,
"name": "core/post-content",
"title": "Post Content",
"category": "design",
"category": "theme",
"description": "Displays the contents of a post or page.",
"textdomain": "default",
"usesContext": [ "postId", "postType", "queryId" ],
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-date/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"apiVersion": 2,
"name": "core/post-date",
"title": "Post Date",
"category": "design",
"category": "theme",
"description": "Add the date of this post.",
"textdomain": "default",
"attributes": {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-excerpt/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"apiVersion": 2,
"name": "core/post-excerpt",
"title": "Post Excerpt",
"category": "design",
"category": "theme",
"description": "Display a post's excerpt.",
"textdomain": "default",
"attributes": {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-featured-image/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"apiVersion": 2,
"name": "core/post-featured-image",
"title": "Post Featured Image",
"category": "design",
"category": "theme",
"description": "Display a post's featured image.",
"textdomain": "default",
"attributes": {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function register_block_core_post_template() {
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.', 'gutenberg' ), $block->name ),
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 );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-template/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "Post Template",
"category": "design",
"parent": [ "core/query" ],
"description": "Post Template.",
"description": "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",
"textdomain": "default",
"usesContext": [
"queryId",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"apiVersion": 2,
"name": "core/post-title",
"title": "Post Title",
"category": "design",
"category": "theme",
"description": "Displays the title of a post, page, or any other content-type.",
"textdomain": "default",
"usesContext": [ "postId", "postType", "queryId" ],
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/blocks/query/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"apiVersion": 2,
"name": "core/query",
"title": "Query Loop",
"category": "design",
"description": "Displays a list of posts as a result of a query.",
"category": "theme",
"description": "An advanced block that allows displaying post types based on different query parameters and visual configurations.",
"textdomain": "default",
"attributes": {
"queryId": {
Expand Down
6 changes: 5 additions & 1 deletion src/wp-includes/blocks/site-tagline.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
* @return string The render.
*/
function render_block_core_site_tagline( $attributes ) {
$site_tagline = get_bloginfo( 'description' );
if ( ! $site_tagline ) {
return;
}
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );

return sprintf(
'<p %1$s>%2$s</p>',
$wrapper_attributes,
get_bloginfo( 'description' )
$site_tagline
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/blocks/site-tagline/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"__experimentalFontFamily": true,
"__experimentalTextTransform": true
}
}
},
"editorStyle": "wp-block-site-tagline-editor"
}
7 changes: 6 additions & 1 deletion src/wp-includes/blocks/site-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@
* @return string The render.
*/
function render_block_core_site_title( $attributes ) {
$site_title = get_bloginfo( 'name' );
if ( ! $site_title ) {
return;
}

$tag_name = 'h1';
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";

if ( isset( $attributes['level'] ) ) {
$tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level'];
}

$link = sprintf( '<a href="%1$s" rel="home">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) );
$link = sprintf( '<a href="%1$s" rel="home">%2$s</a>', get_bloginfo( 'url' ), $site_title );
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );

return sprintf(
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/blocks/site-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"__experimentalFontStyle": true,
"__experimentalFontWeight": true
}
}
},
"editorStyle": "wp-block-site-title-editor"
}
1 change: 1 addition & 0 deletions src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,5 +657,6 @@
add_filter( 'render_block_context', '_block_template_render_without_post_block_context' );
add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 );
add_action( 'wp_footer', 'the_block_template_skip_link' );
add_action( 'setup_theme', 'wp_enable_block_templates' );

unset( $filter, $action );
13 changes: 11 additions & 2 deletions src/wp-includes/theme-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,14 @@ function the_block_template_skip_link() {
<?php
}

// By default, themes support block templates.
add_theme_support( 'block-templates' );
/**
* Enable the block templates (editor mode) for themes with theme.json by default.
*
* @access private
* @since 5.8.0
*/
function wp_enable_block_templates() {
if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
add_theme_support( 'block-templates' );
}
}