Make WordPress Core


Ignore:
Timestamp:
02/03/2023 12:34:59 AM (17 months ago)
Author:
hellofromTonya
Message:

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:

Follow-up to [54274].

Props isabel_brison, andrewserong, jameskoster, joen, onemaggie , ndiego.
Fixes #57602.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/layout.php

    r55167 r55201  
    208208
    209209        if ( 'horizontal' === $layout_orientation ) {
    210             $justify_content_options += array( 'space-between' => 'space-between' );
     210            $justify_content_options    += array( 'space-between' => 'space-between' );
     211            $vertical_alignment_options += array( 'stretch' => 'stretch' );
     212        } else {
     213            $justify_content_options    += array( 'stretch' => 'stretch' );
     214            $vertical_alignment_options += array( 'space-between' => 'space-between' );
    211215        }
    212216
     
    275279                    'selector'     => $selector,
    276280                    'declarations' => array( 'align-items' => 'flex-start' ),
     281                );
     282            }
     283            if ( ! empty( $layout['verticalAlignment'] ) && array_key_exists( $layout['verticalAlignment'], $vertical_alignment_options ) ) {
     284                $layout_styles[] = array(
     285                    'selector'     => $selector,
     286                    'declarations' => array( 'justify-content' => $vertical_alignment_options[ $layout['verticalAlignment'] ] ),
    277287                );
    278288            }
Note: See TracChangeset for help on using the changeset viewer.