From d855031f7d40f6df9a76512c9ea914f8809a6c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= Date: Wed, 22 Apr 2026 12:55:06 +0200 Subject: [PATCH] twentysixteen: Add a control for the user to select text alignment Related: https://core.trac.wordpress.org/ticket/65111 --- .../themes/twentysixteen/functions.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/wp-content/themes/twentysixteen/functions.php b/src/wp-content/themes/twentysixteen/functions.php index 696c5431e4f51..91c9ecbb8adad 100644 --- a/src/wp-content/themes/twentysixteen/functions.php +++ b/src/wp-content/themes/twentysixteen/functions.php @@ -624,3 +624,25 @@ function twentysixteen_widget_tag_cloud_args( $args ) { return $args; } add_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args' ); + +/** + * Registers Custom Block Styles. + * + * @since Twenty Sixteen 3.9 + */ +if ( function_exists( 'register_block_style' ) ) { + function twentysixteen_register_block_styles() { + + // Add a control for the user to select text alignment. + // @ticket 65111 + register_block_style( + 'core/image', + array( + 'name' => 'caption-center', + 'label' => __( 'Text align center', 'twentysixteen' ), + 'inline_style' => '.wp-block-image.is-style-caption-center figcaption { text-align: center; }', + ) + ); + } + add_action( 'init', 'twentysixteen_register_block_styles' ); +}