Editor: Add missing controls to flex layouts in `wp_get_layout_style()`.

Adds missing controls to flex layouts in `wp_get_layout_style()` for justify-content and vertical alignment options.

References:
* [https://github.com/WordPress/gutenberg/pull/47134 Gutenberg PR 47134].

Follow-up to [54274].

Props isabel_brison, andrewserong, jameskoster, joen, onemaggie , ndiego.
Fixes #57602.
Built from https://develop.svn.wordpress.org/trunk@55201


git-svn-id: http://core.svn.wordpress.org/trunk@54734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2023-02-03 00:36:17 +00:00
parent fbfd2b4372
commit a35991eb44
2 changed files with 12 additions and 2 deletions

View File

@ -208,6 +208,10 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
if ( 'horizontal' === $layout_orientation ) { if ( 'horizontal' === $layout_orientation ) {
$justify_content_options += array( 'space-between' => 'space-between' ); $justify_content_options += array( 'space-between' => 'space-between' );
$vertical_alignment_options += array( 'stretch' => 'stretch' );
} else {
$justify_content_options += array( 'stretch' => 'stretch' );
$vertical_alignment_options += array( 'space-between' => 'space-between' );
} }
if ( ! empty( $layout['flexWrap'] ) && 'nowrap' === $layout['flexWrap'] ) { if ( ! empty( $layout['flexWrap'] ) && 'nowrap' === $layout['flexWrap'] ) {
@ -276,6 +280,12 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
'declarations' => array( 'align-items' => 'flex-start' ), 'declarations' => array( 'align-items' => 'flex-start' ),
); );
} }
if ( ! empty( $layout['verticalAlignment'] ) && array_key_exists( $layout['verticalAlignment'], $vertical_alignment_options ) ) {
$layout_styles[] = array(
'selector' => $selector,
'declarations' => array( 'justify-content' => $vertical_alignment_options[ $layout['verticalAlignment'] ] ),
);
}
} }
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.2-alpha-55200'; $wp_version = '6.2-alpha-55201';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.