From 3db444b6cbe8e67ee00cc43aca43b83300fa83dd Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 31 Aug 2023 07:53:47 +0200 Subject: [PATCH] Post navigation link: Fix the writing mode setting on the front. (#54053) Add style attributes to the wrapper in the index.php file --- .../block-library/src/post-navigation-link/index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/post-navigation-link/index.php b/packages/block-library/src/post-navigation-link/index.php index cb066ad69f2c5..8b5d82e745aee 100644 --- a/packages/block-library/src/post-navigation-link/index.php +++ b/packages/block-library/src/post-navigation-link/index.php @@ -28,7 +28,16 @@ function render_block_core_post_navigation_link( $attributes, $content ) { if ( isset( $attributes['textAlign'] ) ) { $classes .= " has-text-align-{$attributes['textAlign']}"; } - $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); + $styles = ''; + if ( isset( $attributes['style']['typography']['writingMode'] ) ) { + $styles = "writing-mode:{$attributes['style']['typography']['writingMode']};"; + } + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'class' => $classes, + 'style' => $styles, + ) + ); // Set default values. $format = '%link'; $link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' );