Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/refactor-pre-publish-tags-to-use-functi…
Browse files Browse the repository at this point in the history
…on-components
  • Loading branch information
fabiankaegy committed Jan 31, 2024
2 parents 095d436 + 702826e commit 0b335cf
Show file tree
Hide file tree
Showing 40 changed files with 757 additions and 500 deletions.
95 changes: 95 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,100 @@
== Changelog ==

= 17.6.0-rc.3 =


## Changelog

### Enhancements

#### Block Library
- Aspect ratio: Remove support on the Group block for now. ([58414](https://github.com/WordPress/gutenberg/pull/58414))
- Image block: Move UI for lightbox from sidebar to the content toolbar alongside link settings. ([57608](https://github.com/WordPress/gutenberg/pull/57608))

#### Font Library
- Improve font collection rest controller. ([58222](https://github.com/WordPress/gutenberg/pull/58222))
- Make notices more consistent. ([58180](https://github.com/WordPress/gutenberg/pull/58180))

#### REST API
- Updates Font Families and Font Faces endpoints context param. ([58287](https://github.com/WordPress/gutenberg/pull/58287))

#### Patterns
- Change text on pattern reset button. ([58286](https://github.com/WordPress/gutenberg/pull/58286))

#### Template Editor
- Remove `template-only` mode from editor and edit-post packages. ([57700](https://github.com/WordPress/gutenberg/pull/57700))


### Bug Fixes

- Interactivity: Fix broken react usage in published package. ([58258](https://github.com/WordPress/gutenberg/pull/58258))

#### Data Views
- DataViews: Fix safari grid row height issue. ([58302](https://github.com/WordPress/gutenberg/pull/58302))
- DataViews: Fix table view cell wrapper and BlockPreviews. ([58062](https://github.com/WordPress/gutenberg/pull/58062))

#### Typography
- Revert "Add defaultFontSizes option to theme.json (#56661)". ([58456](https://github.com/WordPress/gutenberg/pull/58456))

#### Block Library
- Block Hooks API: Update Navigation block feature gate. ([58388](https://github.com/WordPress/gutenberg/pull/58388))

#### Synced Patterns
- Block Bindings: Fix bindings image placeholder showing in patterns overrides. ([58252](https://github.com/WordPress/gutenberg/pull/58252))


### Code Quality

- Shadow: Remove additional wrapper around getShadowClassesAndStyles. ([58297](https://github.com/WordPress/gutenberg/pull/58297))

#### Block Library
- Block Hooks API: Remove $post check from Navigation hooked blocks meta fn. ([58379](https://github.com/WordPress/gutenberg/pull/58379))
- Post navigation link: Coding standard fixes. ([58380](https://github.com/WordPress/gutenberg/pull/58380))
- Update docblock for render_block_core_pattern. ([58382](https://github.com/WordPress/gutenberg/pull/58382))
- Block Hooks API: Update doc block for block_core_navigation_insert_hooked_blocks. ([58378](https://github.com/WordPress/gutenberg/pull/58378))

#### Font Library
- Remove unused utilities and rename class. ([58342](https://github.com/WordPress/gutenberg/pull/58342))
- Rename the slug of the google fonts collection from 'default-font-collection' to 'google-fonts'. ([58331](https://github.com/WordPress/gutenberg/pull/58331))
- Refactored download/upload logic to support font faces with multiple src assets. ([58216](https://github.com/WordPress/gutenberg/pull/58216))
- Font Library: Addresses additional REST API feedback. ([58333](https://github.com/WordPress/gutenberg/pull/58333))

#### Synced Patterns
- Block Bindings: Change `core/pattern-attributes` source for `core/pattern-overrides`. ([58434](https://github.com/WordPress/gutenberg/pull/58434))

#### Custom Fields
- Block Bindings: Simplify block bindings object. ([58337](https://github.com/WordPress/gutenberg/pull/58337))
- Block Bindings: Adapt block bindings to wordpress code latest changes. ([58383](https://github.com/WordPress/gutenberg/pull/58383))



## Contributors

The following contributors merged PRs in this release:

@andrewserong @artemiomorales @c4rl0sbr4v0 @carolinan @creativecoder @dsas @glendaviesnz @madhusudhand @matiasbenedetto @mikachan @ntsekouras @pbking @SantosGuillamot @sirreal @tjcafferkey


= 17.5.3 =


## Changelog

### Bug Fixes

#### Block Library
- Navigation: Update the navigaiton renderer class name so that it doesn't clash with the one backported to core. ([58429](https://github.com/WordPress/gutenberg/pull/58429))




## Contributors

The following contributors merged PRs in this release:

@scruffian


= 17.6.0-rc.2 =

## Changelog
Expand Down
15 changes: 11 additions & 4 deletions docs/contributors/code/back-merging-to-wp-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

For major releases of the WordPress software, Gutenberg features need to be merged into WordPress Core. Typically this involves taking changes made in `.php` files within the Gutenberg repository and making the equivalent updates in the WP Core codebase.

## Files/Directories
## Criteria

### Files/Directories

Changes to files within the following files/directories will typically require back-merging to WP Core:

- `lib/`
- `phpunit/`

## Ignored directories/files
### Ignored directories/files

The following directories/files do _not_ require back-merging to WP Core:

Expand All @@ -21,11 +23,16 @@ The following directories/files do _not_ require back-merging to WP Core:

Please note this list is not exhaustive.

## Pull Request Criteria
### Pull Request Criteria

In general, all PHP code committed to the Gutenberg repository since the date of the final Gutenberg release that was included in [the _last_ stable WP Core release](https://developer.wordpress.org/block-editor/contributors/versions-in-wordpress/) should be considered for back merging to WP Core.

There are however certain exceptions to that rule. PRs with the following criteria do _not_ require back-merging to WP Core:

- Does not contain changes to PHP code.
- Has label `Backport from WordPress Core` - this code is already in WP Core.
- Has label `Backport from WordPress Core` - this code is already in WP Core and is being synchronized back to Gutenberg.
- Has label `Backport to WordPress Core` - this code has already been syncrhonized to WP Core.

## Further Reading

Please see also additional documentation regarding [Gutenberg PHP code](/lib/README.md).
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ Settings related to typography.

| Property | Type | Default | Props |
| --- | --- | --- |--- |
| defaultFontSizes | boolean | true | |
| customFontSize | boolean | true | |
| fontStyle | boolean | true | |
| fontWeight | boolean | true | |
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.3
* Requires PHP: 7.0
* Version: 17.6.0-rc.2
* Version: 17.6.0-rc.3
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
29 changes: 14 additions & 15 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class WP_Theme_JSON_Gutenberg {
),
array(
'path' => array( 'typography', 'fontSizes' ),
'prevent_override' => array( 'typography', 'defaultFontSizes' ),
'prevent_override' => false,
'use_default_names' => true,
'value_func' => 'gutenberg_get_typography_font_size_value',
'css_vars' => '--wp--preset--font-size--$slug',
Expand Down Expand Up @@ -413,20 +413,19 @@ class WP_Theme_JSON_Gutenberg {
'defaultPresets' => null,
),
'typography' => array(
'fluid' => null,
'customFontSize' => null,
'defaultFontSizes' => null,
'dropCap' => null,
'fontFamilies' => null,
'fontSizes' => null,
'fontStyle' => null,
'fontWeight' => null,
'letterSpacing' => null,
'lineHeight' => null,
'textColumns' => null,
'textDecoration' => null,
'textTransform' => null,
'writingMode' => null,
'fluid' => null,
'customFontSize' => null,
'dropCap' => null,
'fontFamilies' => null,
'fontSizes' => null,
'fontStyle' => null,
'fontWeight' => null,
'letterSpacing' => null,
'lineHeight' => null,
'textColumns' => null,
'textDecoration' => null,
'textTransform' => null,
'writingMode' => null,
),
);

Expand Down
91 changes: 0 additions & 91 deletions lib/compat/wordpress-6.4/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,97 +5,6 @@
* @package gutenberg
*/

/**
* Updates the registered inline script `wp-date` required for moment.js localization.
* Changes to the inline script output should be synced with Core in the file
* src/wp-includes/script-loader.php in `wp_default_packages_inline_scripts()`.
*
* @since 6.4.0
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @param WP_Scripts $scripts WP_Scripts object.
*/
function gutenberg_update_wp_date_settings( $scripts ) {
if ( did_action( 'init' ) && $scripts->query( 'wp-date', 'registered' ) ) {
global $wp_locale;
// Calculate the timezone abbr (EDT, PST) if possible.
$timezone_string = get_option( 'timezone_string', 'UTC' );
$timezone_abbr = '';

if ( ! empty( $timezone_string ) ) {
$timezone_date = new DateTime( 'now', new DateTimeZone( $timezone_string ) );
$timezone_abbr = $timezone_date->format( 'T' );
}
$scripts->registered['wp-date']->extra['after'] = array(
false,
sprintf(
'wp.date.setSettings( %s );',
wp_json_encode(
array(
'l10n' => array(
'locale' => get_user_locale(),
'months' => array_values( $wp_locale->month ),
'monthsShort' => array_values( $wp_locale->month_abbrev ),
'weekdays' => array_values( $wp_locale->weekday ),
'weekdaysShort' => array_values( $wp_locale->weekday_abbrev ),
'meridiem' => (object) $wp_locale->meridiem,
'relative' => array(
/* translators: %s: Duration. */
'future' => __( '%s from now', 'gutenberg' ),
/* translators: %s: Duration. */
'past' => __( '%s ago', 'gutenberg' ),
/* translators: One second from or to a particular datetime, e.g., "a second ago" or "a second from now". */
's' => __( 'a second', 'gutenberg' ),
/* translators: %s: Duration in seconds from or to a particular datetime, e.g., "4 seconds ago" or "4 seconds from now". */
'ss' => __( '%d seconds', 'gutenberg' ),
/* translators: One minute from or to a particular datetime, e.g., "a minute ago" or "a minute from now". */
'm' => __( 'a minute', 'gutenberg' ),
/* translators: %s: Duration in minutes from or to a particular datetime, e.g., "4 minutes ago" or "4 minutes from now". */
'mm' => __( '%d minutes', 'gutenberg' ),
/* translators: %s: One hour from or to a particular datetime, e.g., "an hour ago" or "an hour from now". */
'h' => __( 'an hour', 'gutenberg' ),
/* translators: %s: Duration in hours from or to a particular datetime, e.g., "4 hours ago" or "4 hours from now". */
'hh' => __( '%d hours', 'gutenberg' ),
/* translators: %s: One day from or to a particular datetime, e.g., "a day ago" or "a day from now". */
'd' => __( 'a day', 'gutenberg' ),
/* translators: %s: Duration in days from or to a particular datetime, e.g., "4 days ago" or "4 days from now". */
'dd' => __( '%d days', 'gutenberg' ),
/* translators: %s: One month from or to a particular datetime, e.g., "a month ago" or "a month from now". */
'M' => __( 'a month', 'gutenberg' ),
/* translators: %s: Duration in months from or to a particular datetime, e.g., "4 months ago" or "4 months from now". */
'MM' => __( '%d months', 'gutenberg' ),
/* translators: %s: One year from or to a particular datetime, e.g., "a year ago" or "a year from now". */
'y' => __( 'a year', 'gutenberg' ),
/* translators: %s: Duration in years from or to a particular datetime, e.g., "4 years ago" or "4 years from now". */
'yy' => __( '%d years', 'gutenberg' ),
),
'startOfWeek' => (int) get_option( 'start_of_week', 0 ),
),
'formats' => array(
/* translators: Time format, see https://www.php.net/manual/datetime.format.php */
'time' => get_option( 'time_format', __( 'g:i a', 'default' ) ),
/* translators: Date format, see https://www.php.net/manual/datetime.format.php */
'date' => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
/* translators: Date/Time format, see https://www.php.net/manual/datetime.format.php */
'datetime' => __( 'F j, Y g:i a', 'default' ),
/* translators: Abbreviated date/time format, see https://www.php.net/manual/datetime.format.php */
'datetimeAbbreviated' => __( 'M j, Y g:i a', 'default' ),
),
'timezone' => array(
'offset' => (float) get_option( 'gmt_offset', 0 ),
'string' => $timezone_string,
'abbr' => $timezone_abbr,
),
)
)
),
);
}
}

add_action( 'wp_default_scripts', 'gutenberg_update_wp_date_settings' );

/**
* Collect the block editor assets that need to be loaded into the editor's iframe.
*
Expand Down
10 changes: 5 additions & 5 deletions lib/compat/wordpress-6.5/block-bindings/sources/pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ function gutenberg_block_bindings_pattern_overrides_callback( $source_attrs, $bl
}

function gutenberg_register_block_bindings_pattern_overrides_source() {
// Override the "core/pattern-attributes" source from core.
if ( array_key_exists( 'core/pattern-attributes', get_all_registered_block_bindings_sources() ) ) {
unregister_block_bindings_source( 'core/pattern-attributes' );
// Override the "core/pattern-overrides" source from core.
if ( array_key_exists( 'core/pattern-overrides', get_all_registered_block_bindings_sources() ) ) {
unregister_block_bindings_source( 'core/pattern-overrides' );
}
register_block_bindings_source(
'core/pattern-attributes',
'core/pattern-overrides',
array(
'label' => __( 'Pattern Attributes' ),
'label' => _x( 'Pattern Overrides', 'block bindings source' ),
'get_value_callback' => 'gutenberg_block_bindings_pattern_overrides_callback',
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ function gutenberg_block_bindings_post_meta_callback( $source_attrs ) {
$post_id = get_the_ID();
}

// If a post isn't public, we need to prevent
// unauthorized users from accessing the post meta.
$post = get_post( $post_id );
if ( ( $post && 'publish' !== $post->post_status && ! current_user_can( 'read_post', $post_id ) ) || post_password_required( $post_id ) ) {
return null;
}

return get_post_meta( $post_id, $source_attrs['key'], true );
}

Expand All @@ -28,7 +35,7 @@ function gutenberg_register_block_bindings_post_meta_source() {
register_block_bindings_source(
'core/post-meta',
array(
'label' => __( 'Post Meta' ),
'label' => _x( 'Post Meta', 'block bindings source' ),
'get_value_callback' => 'gutenberg_block_bindings_post_meta_callback',
)
);
Expand Down
9 changes: 5 additions & 4 deletions lib/compat/wordpress-6.5/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
* Changes to the inline script output should be synced with Core in the file
* src/wp-includes/script-loader.php in `wp_default_packages_inline_scripts()`.
*
* @since 6.5.0
* @since 6.4.0 Added relative time date strings.
* @since 6.5.0 Added timezone offset value.
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @param WP_Scripts $scripts WP_Scripts object.
*/
function gutenberg_update_wp_date_timezone_settings( $scripts ) {
if ( $scripts->query( 'wp-date', 'registered' ) ) {
function gutenberg_update_wp_date_settings( $scripts ) {
if ( did_action( 'init' ) && $scripts->query( 'wp-date', 'registered' ) ) {
global $wp_locale;
// Calculate the timezone abbr (EDT, PST) if possible.
$timezone_string = get_option( 'timezone_string', 'UTC' );
Expand Down Expand Up @@ -98,4 +99,4 @@ function gutenberg_update_wp_date_timezone_settings( $scripts ) {
}
}

add_action( 'wp_default_scripts', 'gutenberg_update_wp_date_timezone_settings' );
add_action( 'wp_default_scripts', 'gutenberg_update_wp_date_settings' );
1 change: 0 additions & 1 deletion lib/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@
},
"typography": {
"customFontSize": true,
"defaultFontSizes": true,
"dropCap": true,
"fontSizes": [
{
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
"version": "17.6.0-rc.2",
"version": "17.6.0-rc.3",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down
Loading

0 comments on commit 0b335cf

Please sign in to comment.