diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 2429ab3adb776..297c80a942901 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1809,9 +1809,19 @@ function get_the_password_form( $post = 0 ) { ); } + $button_class = ''; + $button_wrapper_open = ''; + $button_wrapper_close = ''; + + if ( wp_is_block_theme() ) { + $button_class = ' class="wp-block-button__link ' . wp_theme_get_element_class_name( 'button' ) . '"'; + $button_wrapper_open = ''; + } + $output = '
+' . $button_wrapper_open . '' . $button_wrapper_close . '
'; /** @@ -1825,6 +1835,7 @@ function get_the_password_form( $post = 0 ) { * @since 2.7.0 * @since 5.8.0 Added the `$post` parameter. * @since 6.8.0 Added the `$invalid_password` parameter. + * @since 7.1.0 Block button classes are added to the submit button for block themes. * * @param string $output The password form HTML output. * @param WP_Post $post Post object.