Skip to content

Commit

Permalink
prep build 09/16
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Sep 16, 2024
2 parents 170b95a + c80fc61 commit 851ef85
Show file tree
Hide file tree
Showing 60 changed files with 2,549 additions and 1,239 deletions.
3 changes: 3 additions & 0 deletions backport-changelog/6.7/7314.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7314

* https://github.com/WordPress/gutenberg/pull/64167
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Add a submenu to your navigation. ([Source](https://github.com/WordPress/gutenbe
- **Name:** core/navigation-submenu
- **Category:** design
- **Parent:** core/navigation
- **Supports:** interactivity (clientNavigation), ~~html~~, ~~reusable~~
- **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** description, id, isTopLevelItem, kind, label, opensInNewTab, rel, title, type, url

## Page Break
Expand Down
6 changes: 4 additions & 2 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ function ( $rollback, $file ) {
define( 'GUTENBERG_VERSION', '9.6.2.20201230' );
define( 'GUTENBERG_GIT_COMMIT', 'd516050927e6f7d8c4d1917f37c46bab00daacec' );
### END AUTO-GENERATED DEFINES
defined( 'GUTENBERG_MINIMUM_WP_VERSION' ) or define( 'GUTENBERG_MINIMUM_WP_VERSION', '6.5' );


gutenberg_pre_init();

Expand All @@ -55,7 +57,7 @@ function ( $rollback, $file ) {
function gutenberg_wordpress_version_notice() {
echo '<div class="error"><p>';
/* translators: %s: Minimum required version */
printf( __( 'Gutenberg requires WordPress %s or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' ), '5.9' );
printf( __( 'Gutenberg requires WordPress %s or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' ), GUTENBERG_MINIMUM_WP_VERSION );
echo '</p></div>';

deactivate_plugins( array( 'gutenberg/gutenberg.php' ) );
Expand Down Expand Up @@ -96,7 +98,7 @@ function gutenberg_pre_init() {
// Compare against major release versions (X.Y) rather than minor (X.Y.Z)
// unless a minor release is the actual minimum requirement. WordPress reports
// X.Y for its major releases.
if ( version_compare( $version, '5.9', '<' ) ) {
if ( version_compare( $version, GUTENBERG_MINIMUM_WP_VERSION, '<' ) ) {
add_action( 'admin_notices', 'gutenberg_wordpress_version_notice' );
return;
}
Expand Down
60 changes: 60 additions & 0 deletions lib/compat/wordpress-6.7/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,63 @@ function gutenberg_filter_block_type_metadata_settings_allow_variations_php_file
return $settings;
}
add_filter( 'block_type_metadata_settings', 'gutenberg_filter_block_type_metadata_settings_allow_variations_php_file', 10, 2 );

/**
* Adds post format query vars to the query loop block's WP_Query when the block's attributes call for them.
*
* @see 'query_loop_block_query_vars'
*
* @param array $query The query vars.
* @param WP_Block $block Block instance.
* @return array The filtered query vars.
*/
function gutenberg_add_format_query_vars_to_query_loop_block( $query, $block ) {
// Return early if there is no format or if the format is not an array.
if ( empty( $block->context['query']['format'] ) || ! is_array( $block->context['query']['format'] ) ) {
return $query;
}

$formats = $block->context['query']['format'];
$tax_query = array( 'relation' => 'OR' );

// The default post format, 'standard', is not stored in the database.
// If 'standard' is part of the request, the query needs to exclude all post items that
// have a format assigned.
if ( in_array( 'standard', $formats, true ) ) {
$tax_query[] = array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array(),
'operator' => 'NOT EXISTS',
);
// Remove the standard format, since it cannot be queried.
unset( $formats[ array_search( 'standard', $formats, true ) ] );
}

// Add any remaining formats to the tax query.
if ( ! empty( $formats ) ) {
// Add the post-format- prefix.
$terms = array_map(
static function ( $format ) {
return 'post-format-' . $format;
},
$formats
);

$tax_query[] = array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => $terms,
'operator' => 'IN',
);
}

// This condition is intended to prevent $tax_query from being added to $query
// if it only contains the relation.
if ( count( $tax_query ) > 1 ) {
$query['tax_query'][] = $tax_query;
}

return $query;
}
add_filter( 'query_loop_block_query_vars', 'gutenberg_add_format_query_vars_to_query_loop_block', 10, 2 );
Loading

0 comments on commit 851ef85

Please sign in to comment.