Commit 3e9f2469ec for wordpress.org
commit 3e9f2469ec7119d1e800c748757b61c8727fbf1c
Author: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Date: Fri Sep 11 16:14:50 2026 +0000
Block Editor: Output `flex-direction: row` when a viewport override switches a flex layout to horizontal.
`row` is the flex default, so the base layout never declares it. When a Tablet or Mobile override switched a vertical (Stack) layout to horizontal, the base `flex-direction: column` kept applying and the block stayed vertical.
Backports https://github.com/WordPress/gutenberg/pull/82364.
Developed in https://github.com/WordPress/wordpress-develop/pull/13370.
Props jorgefilipecosta, talldanwp, firdaus666.
Fixes #66096.
Built from https://develop.svn.wordpress.org/trunk@63602
git-svn-id: http://core.svn.wordpress.org/trunk@62778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/block-supports/layout.php b/wp-includes/block-supports/layout.php
index 24431a05bb..b7c0503d3b 100644
--- a/wp-includes/block-supports/layout.php
+++ b/wp-includes/block-supports/layout.php
@@ -792,6 +792,17 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
$flex_vertical_alignment = $layout_for_styles['verticalAlignment'] ?? null;
if ( 'horizontal' === $layout_orientation ) {
+ /*
+ * `row` is the flex default, so the base layout never declares it. A viewport
+ * override that switches a vertical base layout to horizontal has to declare
+ * it explicitly, otherwise the base `flex-direction: column` keeps applying.
+ */
+ if ( null !== $viewport_overrides && $has_viewport_property_override( 'orientation' ) ) {
+ $layout_styles[] = array(
+ 'selector' => $selector,
+ 'declarations' => array( 'flex-direction' => 'row' ),
+ );
+ }
/*
* Add this style only if is not empty for backwards compatibility,
* since we intend to convert blocks that had flex layout implemented
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 6c982a77d6..b6b2f35e1a 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-63601';
+$wp_version = '7.2-alpha-63602';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.