Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into feature/search-query…
Browse files Browse the repository at this point in the history
…-using-vars-filter
  • Loading branch information
michalczaplinski committed Dec 12, 2024
2 parents 2e7432d + e283f73 commit 049fc67
Show file tree
Hide file tree
Showing 400 changed files with 11,975 additions and 13,337 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ concurrency:

jobs:
test:
runs-on: macos-12
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
runs-on: macos-13
if: false
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
matrix:
native-test-name: [gutenberg-editor-rendering]
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ concurrency:

jobs:
test:
runs-on: macos-12
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
runs-on: macos-13
if: false
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
matrix:
xcode: ['14.2']
Expand Down
3 changes: 3 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"plugins": [ "." ],
"themes": [ "./test/emptytheme" ],
"env": {
"development": {
"phpmyadminPort": 9000
},
"tests": {
"mappings": {
"wp-content/plugins/gutenberg": ".",
Expand Down
28 changes: 28 additions & 0 deletions assets/blueprints/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/post.php?post=1&action=edit",
"plugins": [ "gutenberg" ],
"login": true,
"features": {
"networking": true
},
"preferredVersions": {
"php": "latest",
"wp": "latest"
},
"steps": [
{
"step": "setSiteOptions",
"options": {
"blogname": "Testing Gutenberg"
}
},
{
"step": "updateUserMeta",
"meta": {
"admin_color": "modern"
},
"userId": 1
}
]
}
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7865.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7865

* https://github.com/WordPress/gutenberg/pull/66851
15 changes: 2 additions & 13 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require( 'path' );
const glob = require( 'fast-glob' );
const fs = require( 'fs' );
const { inc: semverInc } = require( 'semver' );
const rimraf = require( 'rimraf' );
const { rimraf } = require( 'rimraf' );
const readline = require( 'readline' );
const SimpleGit = require( 'simple-git' );

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

/**
* Throws if given an error in the node.js callback style.
*
* @param {any|null} error If callback failed, this will hold a value.
*/
const rethrow = ( error ) => {
if ( error ) {
throw error;
}
};

/**
* Checks out the npm release branch.
*
Expand Down Expand Up @@ -599,7 +588,7 @@ async function runPackagesRelease( config, customMessages ) {
await Promise.all(
temporaryFolders
.filter( ( tempDir ) => fs.existsSync( tempDir ) )
.map( ( tempDir ) => rimraf( tempDir, rethrow ) )
.map( ( tempDir ) => rimraf( tempDir ) )
)
);

Expand Down
384 changes: 384 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/contributors/code/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The [Gutenberg repository](https://github.com/WordPress/gutenberg) on GitHub is
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:

- 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.
- Have write permissions on the [Make WordPress Core](http://make.wordpress.org/core) blog. This allows you to draft the release post.
- Have write permissions on the [Make WordPress Core](https://make.wordpress.org/core) blog. This allows you to draft the release post.
- Obtain approval from a member of the Gutenberg Core team in order to upload the new version Gutenberg to the WordPress.org plugin directory.

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).
Expand Down Expand Up @@ -344,7 +344,7 @@ To do this, when running the Workflow, select the appropriate `release/` branch

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.

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.
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.

**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!

Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Gutenberg project uses GitHub for managing code and tracking issues. The mai

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.

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.
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.

## Principles

Expand Down
10 changes: 10 additions & 0 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,16 @@ Display the query title. ([Source](https://github.com/WordPress/gutenberg/tree/t
- **Supports:** align (full, wide), color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** level, levelOptions, showPrefix, showSearchTerm, textAlign, type

## Query Total

Display the total number of results in a query. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/query-total))

- **Name:** core/query-total
- **Category:** theme
- **Ancestor:** core/query
- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** displayType

## Quote

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))
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 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.6
* Requires PHP: 7.2
* Version: 19.8.0
* Version: 19.9.0-rc.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
13 changes: 13 additions & 0 deletions lib/block-editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ function gutenberg_get_block_editor_settings( $settings ) {
$global_styles[] = $block_classes;
}

// Get any additional css from the customizer and add it before global styles custom CSS.
$global_styles[] = array(
'css' => wp_get_custom_css(),
'__unstableType' => 'user',
'isGlobalStyles' => false,
);

/*
* Add the custom CSS as a separate stylesheet so any invalid CSS
* entered by users does not break other global styles.
Expand All @@ -74,6 +81,12 @@ function gutenberg_get_block_editor_settings( $settings ) {
$block_classes['css'] = $actual_css;
$global_styles[] = $block_classes;
}
// Get any additional css from the customizer.
$global_styles[] = array(
'css' => wp_get_custom_css(),
'__unstableType' => 'user',
'isGlobalStyles' => false,
);
}

$settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );
Expand Down
1 change: 1 addition & 0 deletions lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function gutenberg_reregister_core_block_types() {
'query-pagination-numbers.php' => 'core/query-pagination-numbers',
'query-pagination-previous.php' => 'core/query-pagination-previous',
'query-title.php' => 'core/query-title',
'query-total.php' => 'core/query-total',
'read-more.php' => 'core/read-more',
'rss.php' => 'core/rss',
'search.php' => 'core/search',
Expand Down
19 changes: 11 additions & 8 deletions lib/compat/wordpress-6.7/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,18 @@ function gutenberg_register_wp_rest_templates_controller_plugin_field() {
}
add_action( 'rest_api_init', 'gutenberg_register_wp_rest_templates_controller_plugin_field' );

/**
* Overrides the default 'WP_REST_Server' class.
*
* @return string The name of the custom server class.
*/
function gutenberg_override_default_rest_server() {
return 'Gutenberg_REST_Server';
// The `get_user` function was introduced in WP 6.7.
if ( ! function_exists( 'get_user' ) ) {
/**
* Overrides the default 'WP_REST_Server' class.
*
* @return string The name of the custom server class.
*/
function gutenberg_override_default_rest_server() {
return 'Gutenberg_REST_Server';
}
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 );
}
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 );


/**
Expand Down
26 changes: 25 additions & 1 deletion lib/compat/wordpress-6.8/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,33 @@ function gutenberg_redirect_site_editor_deprecated_urls() {
* @return callable The default handler or a custom handler.
*/
function gutenberg_styles_wp_die_handler( $default_handler ) {
if ( ! wp_is_block_theme() && str_contains( $_SERVER['REQUEST_URI'], 'site-editor.php' ) && isset( $_GET['p'] ) ) {
if ( ! wp_is_block_theme() && str_contains( $_SERVER['REQUEST_URI'], 'site-editor.php' ) && current_user_can( 'edit_theme_options' ) ) {
return '__return_false';
}
return $default_handler;
}
add_filter( 'wp_die_handler', 'gutenberg_styles_wp_die_handler' );

/**
* Add a Styles submenu under the Appearance menu
* for Classic themes.
*
* @global array $submenu
*/
function gutenberg_add_styles_submenu_item() {
if ( ! wp_is_block_theme() && ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ) ) {
global $submenu;

$styles_menu_item = array(
__( 'Design', 'gutenberg' ),
'edit_theme_options',
'site-editor.php',
);
// If $submenu exists, insert the Styles submenu item at position 2.
if ( $submenu && isset( $submenu['themes.php'] ) ) {
// This might not work as expected if the submenu has already been modified.
array_splice( $submenu['themes.php'], 1, 1, array( $styles_menu_item ) );
}
}
}
add_action( 'admin_init', 'gutenberg_add_styles_submenu_item' );
Loading

0 comments on commit 049fc67

Please sign in to comment.