Skip to content

Commit 228e924

Browse files
Merge branch 'WordPress:trunk' into trunk
2 parents efe57e5 + 2eec579 commit 228e924

File tree

164 files changed

+7907
-6792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+7907
-6792
lines changed

.github/workflows/rnmobile-android-runner.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ concurrency:
1414

1515
jobs:
1616
test:
17-
runs-on: macos-12
18-
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
17+
runs-on: macos-13
18+
if: false
19+
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
1920
strategy:
2021
matrix:
2122
native-test-name: [gutenberg-editor-rendering]

.github/workflows/rnmobile-ios-runner.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ concurrency:
1414

1515
jobs:
1616
test:
17-
runs-on: macos-12
18-
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
17+
runs-on: macos-13
18+
if: false
19+
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
1920
strategy:
2021
matrix:
2122
xcode: ['14.2']

.wp-env.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"plugins": [ "." ],
55
"themes": [ "./test/emptytheme" ],
66
"env": {
7+
"development": {
8+
"phpmyadminPort": 9000
9+
},
710
"tests": {
811
"mappings": {
912
"wp-content/plugins/gutenberg": ".",

backport-changelog/6.8/7865.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7865
2+
3+
* https://github.com/WordPress/gutenberg/pull/66851

bin/plugin/commands/packages.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const path = require( 'path' );
66
const glob = require( 'fast-glob' );
77
const fs = require( 'fs' );
88
const { inc: semverInc } = require( 'semver' );
9-
const rimraf = require( 'rimraf' );
9+
const { rimraf } = require( 'rimraf' );
1010
const readline = require( 'readline' );
1111
const SimpleGit = require( 'simple-git' );
1212

@@ -60,17 +60,6 @@ const pluginConfig = require( '../config' );
6060
* @property {ReleaseType} releaseType The selected release type.
6161
*/
6262

63-
/**
64-
* Throws if given an error in the node.js callback style.
65-
*
66-
* @param {any|null} error If callback failed, this will hold a value.
67-
*/
68-
const rethrow = ( error ) => {
69-
if ( error ) {
70-
throw error;
71-
}
72-
};
73-
7463
/**
7564
* Checks out the npm release branch.
7665
*
@@ -599,7 +588,7 @@ async function runPackagesRelease( config, customMessages ) {
599588
await Promise.all(
600589
temporaryFolders
601590
.filter( ( tempDir ) => fs.existsSync( tempDir ) )
602-
.map( ( tempDir ) => rimraf( tempDir, rethrow ) )
591+
.map( ( tempDir ) => rimraf( tempDir ) )
603592
)
604593
);
605594

docs/contributors/code/release.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The [Gutenberg repository](https://github.com/WordPress/gutenberg) on GitHub is
55
Before you begin, there are some requirements that must be met in order to successfully release a stable version of the Gutenberg plugin. You will need to:
66

77
- Be a member of the [Gutenberg development team](https://developer.wordpress.org/block-editor/block-editor/contributors/repository-management/#teams). This gives you the ability to launch the GitHub actions that are related to the release process and to backport pull requests (PRs) to the release branch.
8-
- Have write permissions on the [Make WordPress Core](http://make.wordpress.org/core) blog. This allows you to draft the release post.
8+
- Have write permissions on the [Make WordPress Core](https://make.wordpress.org/core) blog. This allows you to draft the release post.
99
- Obtain approval from a member of the Gutenberg Core team in order to upload the new version Gutenberg to the WordPress.org plugin directory.
1010

1111
Similar requirements apply to releasing WordPress's [npm packages](https://developer.wordpress.org/block-editor/contributors/code/release/#packages-releases-to-npm-and-wordpress-core-updates).
@@ -344,7 +344,7 @@ To do this, when running the Workflow, select the appropriate `release/` branch
344344

345345
It is possible to create a minor release for any release branch even after a more recent stable release has been published. This can be done for _any_ previous release branches, allowing more flexibility in delivering updates to users. In the past, users had to wait for the next stable release, potentially taking days. Now, fixes can be swiftly shipped to any previous release branches as required.
346346

347-
The process is identical to the one documented above when an RC is already out: choose a previous release branch, type `stable`, and click "Run workflow". The release will be published on the GitHub releases page for Gutenberg and to the WordPress core repository SVN as a `tag` under http://plugins.svn.wordpress.org/gutenberg/tags/. The SVN `trunk` directory will not be touched.
347+
The process is identical to the one documented above when an RC is already out: choose a previous release branch, type `stable`, and click "Run workflow". The release will be published on the GitHub releases page for Gutenberg and to the WordPress core repository SVN as a `tag` under https://plugins.svn.wordpress.org/gutenberg/tags/. The SVN `trunk` directory will not be touched.
348348

349349
**IMPORTANT:** When publishing the draft created by the ["Build Plugin Zip" workflow](https://github.com/WordPress/gutenberg/actions/workflows/build-plugin-zip.yml), make sure to leave the "Set as last release" checkbox unchecked. If it is left checked by accident, the ["Upload Gutenberg plugin to WordPress.org plugin" workflow](https://github.com/WordPress/gutenberg/actions/workflows/upload-release-to-plugin-repo.yml) will still correctly upload it **as a tag (and will _not_ replace the `trunk` version)** to the WordPress plugin repository SVN - the workflow will perform some version arithmetic to determine how the plugin should be shipped - but you'll still need to fix the state on GitHub by setting the right release as `latest` on the [releases](https://github.com/WordPress/gutenberg/releases/) page!
350350

docs/contributors/design/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Gutenberg project uses GitHub for managing code and tracking issues. The mai
1414

1515
If you'd like to contribute to the design or front-end, feel free to contribute to tickets labeled [Needs Design](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A%22Needs+Design%22) or [Needs Design Feedback](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A"Needs+Design+Feedback%22). We could use your thoughtful replies, mockups, animatics, sketches, doodles. Proposed changes are best done as minimal and specific iterations on the work that precedes it so we can compare.
1616

17-
The [WordPress Design team](http://make.wordpress.org/design/) uses [Figma](https://www.figma.com/) to collaborate and share work. If you'd like to contribute, join the [#design channel](http://wordpress.slack.com/messages/design/) in [Slack](https://make.wordpress.org/chat/) and ask the team to set you up with a free Figma account. This will give you access to a helpful [library of components](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=0%3A1) used in WordPress.
17+
The [WordPress Design team](https://make.wordpress.org/design/) uses [Figma](https://www.figma.com/) to collaborate and share work. If you'd like to contribute, join the [#design channel](https://wordpress.slack.com/messages/design/) in [Slack](https://make.wordpress.org/chat/) and ask the team to set you up with a free Figma account. This will give you access to a helpful [library of components](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=0%3A1) used in WordPress.
1818

1919
## Principles
2020

docs/reference-guides/core-blocks.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ Contains the block elements used to render a post, like the title, date, feature
660660

661661
- **Name:** core/post-template
662662
- **Category:** theme
663-
- **Parent:** core/query
663+
- **Ancestor:** core/query
664664
- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
665665

666666
## Post Terms
@@ -724,7 +724,7 @@ Contains the block elements used to render content when no query results are fou
724724

725725
- **Name:** core/query-no-results
726726
- **Category:** theme
727-
- **Parent:** core/query
727+
- **Ancestor:** core/query
728728
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
729729

730730
## Pagination
@@ -777,6 +777,16 @@ Display the query title. ([Source](https://github.com/WordPress/gutenberg/tree/t
777777
- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
778778
- **Attributes:** level, levelOptions, showPrefix, showSearchTerm, textAlign, type
779779

780+
## Query Total
781+
782+
Display the total number of results in a query. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/query-total))
783+
784+
- **Name:** core/query-total
785+
- **Category:** theme
786+
- **Ancestor:** core/query
787+
- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
788+
- **Attributes:** displayType
789+
780790
## Quote
781791

782792
Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/quote))

lib/block-editor-settings.php

+13
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ function gutenberg_get_block_editor_settings( $settings ) {
5353
$global_styles[] = $block_classes;
5454
}
5555

56+
// Get any additional css from the customizer and add it before global styles custom CSS.
57+
$global_styles[] = array(
58+
'css' => wp_get_custom_css(),
59+
'__unstableType' => 'user',
60+
'isGlobalStyles' => false,
61+
);
62+
5663
/*
5764
* Add the custom CSS as a separate stylesheet so any invalid CSS
5865
* entered by users does not break other global styles.
@@ -74,6 +81,12 @@ function gutenberg_get_block_editor_settings( $settings ) {
7481
$block_classes['css'] = $actual_css;
7582
$global_styles[] = $block_classes;
7683
}
84+
// Get any additional css from the customizer.
85+
$global_styles[] = array(
86+
'css' => wp_get_custom_css(),
87+
'__unstableType' => 'user',
88+
'isGlobalStyles' => false,
89+
);
7790
}
7891

7992
$settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );

lib/blocks.php

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function gutenberg_reregister_core_block_types() {
108108
'query-pagination-numbers.php' => 'core/query-pagination-numbers',
109109
'query-pagination-previous.php' => 'core/query-pagination-previous',
110110
'query-title.php' => 'core/query-title',
111+
'query-total.php' => 'core/query-total',
111112
'read-more.php' => 'core/read-more',
112113
'rss.php' => 'core/rss',
113114
'search.php' => 'core/search',

lib/compat/wordpress-6.7/rest-api.php

+11-8
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,18 @@ function gutenberg_register_wp_rest_templates_controller_plugin_field() {
124124
}
125125
add_action( 'rest_api_init', 'gutenberg_register_wp_rest_templates_controller_plugin_field' );
126126

127-
/**
128-
* Overrides the default 'WP_REST_Server' class.
129-
*
130-
* @return string The name of the custom server class.
131-
*/
132-
function gutenberg_override_default_rest_server() {
133-
return 'Gutenberg_REST_Server';
127+
// The `get_user` function was introduced in WP 6.7.
128+
if ( ! function_exists( 'get_user' ) ) {
129+
/**
130+
* Overrides the default 'WP_REST_Server' class.
131+
*
132+
* @return string The name of the custom server class.
133+
*/
134+
function gutenberg_override_default_rest_server() {
135+
return 'Gutenberg_REST_Server';
136+
}
137+
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 );
134138
}
135-
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 );
136139

137140

138141
/**

lib/compat/wordpress-6.8/site-editor.php

+25-1
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,33 @@ function gutenberg_redirect_site_editor_deprecated_urls() {
116116
* @return callable The default handler or a custom handler.
117117
*/
118118
function gutenberg_styles_wp_die_handler( $default_handler ) {
119-
if ( ! wp_is_block_theme() && str_contains( $_SERVER['REQUEST_URI'], 'site-editor.php' ) && isset( $_GET['p'] ) ) {
119+
if ( ! wp_is_block_theme() && str_contains( $_SERVER['REQUEST_URI'], 'site-editor.php' ) && current_user_can( 'edit_theme_options' ) ) {
120120
return '__return_false';
121121
}
122122
return $default_handler;
123123
}
124124
add_filter( 'wp_die_handler', 'gutenberg_styles_wp_die_handler' );
125+
126+
/**
127+
* Add a Styles submenu under the Appearance menu
128+
* for Classic themes.
129+
*
130+
* @global array $submenu
131+
*/
132+
function gutenberg_add_styles_submenu_item() {
133+
if ( ! wp_is_block_theme() && ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ) ) {
134+
global $submenu;
135+
136+
$styles_menu_item = array(
137+
__( 'Design', 'gutenberg' ),
138+
'edit_theme_options',
139+
'site-editor.php',
140+
);
141+
// If $submenu exists, insert the Styles submenu item at position 2.
142+
if ( $submenu && isset( $submenu['themes.php'] ) ) {
143+
// This might not work as expected if the submenu has already been modified.
144+
array_splice( $submenu['themes.php'], 1, 1, array( $styles_menu_item ) );
145+
}
146+
}
147+
}
148+
add_action( 'admin_init', 'gutenberg_add_styles_submenu_item' );

0 commit comments

Comments
 (0)